Add support for HS color to mqtt light#16958
Merged
balloob merged 2 commits intohome-assistant:devfrom Oct 8, 2018
Merged
Conversation
houndci-bot
reviewed
Sep 29, 2018
2ea0892 to
4ff98a2
Compare
Merged
2 tasks
balloob
reviewed
Oct 1, 2018
| _LOGGER.debug("Ignoring empty hs message from '%s'", topic) | ||
| return | ||
|
|
||
| hs_color = [float(val) for val in payload.split(',')][0:2] |
Member
There was a problem hiding this comment.
We should catch ValueError in case it's not valid data.
Member
There was a problem hiding this comment.
Also make it .split(',', 2) to capture more invalid data.
Contributor
Author
There was a problem hiding this comment.
Alright, something like below then?
try:
hs_color = [float(val) for val in payload.split(',', 2)][0:2]
self._hs = hs_color
self.async_schedule_update_ha_state()
except (ValueError):
_LOGGER.debug("Failed to parse hs state update: '%s'", payload)
houndci-bot
reviewed
Oct 2, 2018
| self._hs = hs_color | ||
| self.async_schedule_update_ha_state() | ||
| except (ValueError): | ||
| _LOGGER.debug("Failed to parse hs state update: '%s'", payload) |
005e4fa to
5e68610
Compare
Contributor
Author
|
@balloob Are more changes required? |
balloob
approved these changes
Oct 8, 2018
Merged
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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:
Add support for HS color to mqtt light
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#6377
Checklist:
tox. Your PR cannot be merged unless tests pass