Add niko-home-control support#18019
Merged
fabaff merged 4 commits intohome-assistant:devfrom Nov 12, 2018
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
houndci-bot
reviewed
Oct 30, 2018
b2b2ee0 to
9eb0b80
Compare
Contributor
9eb0b80 to
e90870e
Compare
2 tasks
fabaff
approved these changes
Nov 12, 2018
Member
fabaff
left a comment
There was a problem hiding this comment.
Thanks 🐦
Please update the documentation as the current state is from April
| 'timeout': 20000, | ||
| 'events': True | ||
| }) | ||
| except socket.error as err: |
Member
There was a problem hiding this comment.
Socket error is deprecated in favor of OSError in modern versions of Python 3.
| }) | ||
|
|
||
|
|
||
| def setup_platform(hass, config, add_devices, discovery_info=None): |
Member
There was a problem hiding this comment.
We have renamed add_devices to add_entities.
| """Set up the Niko Home Control light platform.""" | ||
| import nikohomecontrol | ||
|
|
||
| host = config.get(CONF_HOST) |
Member
There was a problem hiding this comment.
Use dict[key] for required config keys.
| """Instruct the light to turn on.""" | ||
| self._light.brightness = kwargs.get(ATTR_BRIGHTNESS, 255) | ||
| self._light.turn_on() | ||
| self._state = True |
Member
There was a problem hiding this comment.
This will be updated by self.update in the end of the service call.
| @property | ||
| def brightness(self): | ||
| """Return the brightness of the light.""" | ||
| return self._brightness |
| def turn_off(self, **kwargs): | ||
| """Instruct the light to turn off.""" | ||
| self._light.turn_off() | ||
| self._state = False |
3 tasks
Merged
22 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This is a follow-up PR for #13755
Add support for niko-home-control
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5137
Example entry for
configuration.yaml(if applicable):Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
REQUIREMENTSvariable ([example][ex-requir]).requirements_all.txtby runningscript/gen_requirements_all.py..coveragerc.