mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
[homematic]Pass channel to light color functions (#27306)
The device HmIP-BSL has two independent LEDs on two different channels, so the channel needs to be explictly specified when setting the color.
This commit is contained in:
parent
9661efc312
commit
6bfb2460f2
@ -66,7 +66,7 @@ class HMLight(HMDevice, Light):
|
|||||||
"""Return the hue and saturation color value [float, float]."""
|
"""Return the hue and saturation color value [float, float]."""
|
||||||
if not self.supported_features & SUPPORT_COLOR:
|
if not self.supported_features & SUPPORT_COLOR:
|
||||||
return None
|
return None
|
||||||
hue, sat = self._hmdevice.get_hs_color()
|
hue, sat = self._hmdevice.get_hs_color(self._channel)
|
||||||
return hue * 360.0, sat * 100.0
|
return hue * 360.0, sat * 100.0
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -98,6 +98,7 @@ class HMLight(HMDevice, Light):
|
|||||||
self._hmdevice.set_hs_color(
|
self._hmdevice.set_hs_color(
|
||||||
hue=kwargs[ATTR_HS_COLOR][0] / 360.0,
|
hue=kwargs[ATTR_HS_COLOR][0] / 360.0,
|
||||||
saturation=kwargs[ATTR_HS_COLOR][1] / 100.0,
|
saturation=kwargs[ATTR_HS_COLOR][1] / 100.0,
|
||||||
|
channel=self._channel,
|
||||||
)
|
)
|
||||||
if ATTR_EFFECT in kwargs:
|
if ATTR_EFFECT in kwargs:
|
||||||
self._hmdevice.set_effect(kwargs[ATTR_EFFECT])
|
self._hmdevice.set_effect(kwargs[ATTR_EFFECT])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user