Skip to content

Fix mqtt_json color commands#13617

Merged
emlove merged 1 commit intodevfrom
mqtt-json-color-fix
Apr 1, 2018
Merged

Fix mqtt_json color commands#13617
emlove merged 1 commit intodevfrom
mqtt-json-color-fix

Conversation

@emlove
Copy link
Copy Markdown
Contributor

@emlove emlove commented Apr 1, 2018

Description:

It looks like after #11288 , the mqtt json color commands were combined, which breaks some lights. This PR fixes the mqtt_json light platform to respect the configuration.

Related issue (if applicable): fixes #13611

if self._rgb:
brightness = kwargs.get(
ATTR_BRIGHTNESS,
self._brightness if self._brightness else 255)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What if self._brightness is 0? Then the hsv to rgb converter would check with full brightness. Probably not really a problem since when brightness is zero, rgb is essentially ignored by the remote device. But still this behavior of having very different values with 0 and 1 brightness seems weird to me. Might very well be wrong though

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Don't disagree, but I'd leave that up to someone who uses this platform. Probably checking for None was the original intention.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Don't disagree, but I'd leave that up to someone who uses this platform. Probably checking for None was the original intention.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I can confirm that PR fixes the problem with scenes

@emlove emlove merged commit be43c3b into dev Apr 1, 2018
@emlove emlove deleted the mqtt-json-color-fix branch April 1, 2018 18:13
balloob pushed a commit that referenced this pull request Apr 1, 2018
@balloob balloob mentioned this pull request Apr 1, 2018
mountainsandcode added a commit to mountainsandcode/home-assistant that referenced this pull request Apr 2, 2018
…into dev

* 'dev' of https://github.com/home-assistant/home-assistant: (43 commits)
  Upgrade py-cpuinfo to 4.0.0 (home-assistant#13629)
  changed PyTado version (home-assistant#13626)
  Hue mireds value is actually 153 not 154 (home-assistant#13601)
  Version bump to 0.66.1
  Fix mysensors sensor type lookup (home-assistant#13574)
  Add pincode fallback (home-assistant#13587)
  Fix mqtt_json color commands (home-assistant#13617)
  Fix mqtt_json color commands (home-assistant#13617)
  Bugfix for tradfri to correctly execute Command. (home-assistant#13618)
  Fix Hue error logging (home-assistant#13616)
  Add pincode fallback (home-assistant#13587)
  Use 0/1 for raspberry pi cover GPIO writes rather than true/false (home-assistant#13610)
  Make mysensors updates and platform setup async (home-assistant#13603)
  Unflake folder watcher test (home-assistant#13569)
  Re-add group polling as a fallback for observation (home-assistant#13613)
  Fix IMAP email message_data (home-assistant#13606)
  Broadlink (home-assistant#13585)
  Version bump frontend done right
  Fix mysensors update callback (home-assistant#13602)
  Version bump to 0.66.1b0
  ...
@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 2018
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.

MQTT RGB support scene broken

6 participants