Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Lutron RadioRA 2 #5269

Closed
wants to merge 2 commits into from

Conversation

robbiet480
Copy link
Member

This is a re-staged clone of the PR that @thecynic proposed in #3832. It was behind dev by almost 7 months and I was unable to get things updated on his PR because of GitHub permissions.


Description:

This PR adds support for the Lutron RadioRA 2. I've been running with it for a few months now and things seem pretty solid. I'm sure there are issues, so bug reports are welcome.

Example entry for configuration.yaml (if applicable):

lutron:
  host: <ip>
  username: lutron
  password: integration

Checklist:

If the code communicates with devices, web services, or third-party tools:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable ([example][ex-requir]).
  • New dependencies are only imported inside functions that use them ([example][ex-import]).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

@mention-bot
Copy link

@robbiet480, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @fabaff and @rmkraus to be potential reviewers.

@robbiet480
Copy link
Member Author

This PR did have a new media_player platform for the Emotiva XMC-1 which I have now removed. That can be submitted on its own at a later time by the original author.

@property
def brightness(self):
"""Return the brightness of the light."""
last_level = self._lutron_device.last_level()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this doing I/O inside properties?

DOMAIN = "lutron"

# List of component names (string) your component depends upon.
DEPENDENCIES = ['group', 'light']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to depend on group or light


LUTRON_CONTROLLER = None

LUTRON_DEVICES = {'light': []}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use hass.data instead of globals

from pylutron import Lutron

config = base_config.get(DOMAIN)
LUTRON_CONTROLLER = Lutron(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hass.data

self._controller = controller
self._area_name = area_name

self.update()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Home Assistant can do this if you add boolean as second param to add_devices: add_devices(devices, True)

@thecynic
Copy link
Contributor

thecynic commented Jan 12, 2017

Note that it was not behind by 7mo, thats just when I originally authored the change. It's a few months behind, but I've updated my local version since then.

I've had my day job keeping me busy to where I haven't had a chance to address the original comments and re-upload. I'd like to do that myself if you don't mind.

Copy link
Contributor

@thecynic thecynic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to re-upload my changes again. I'm going to find some time to do it for real this time :) Could you please abandon yours?

@robbiet480
Copy link
Member Author

@thecynic Sure that's fine!

@robbiet480 robbiet480 closed this Jan 12, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Apr 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants