mirror of
https://github.com/andvikt/mega_hacs.git
synced 2025-12-13 10:04:28 +05:00
fix rgb color
This commit is contained in:
@@ -244,9 +244,12 @@ class MegaRGBW(LightEntity, BaseMegaEntity):
|
|||||||
async def set_color(self, _before, **kwargs):
|
async def set_color(self, _before, **kwargs):
|
||||||
transition = kwargs.get('transition')
|
transition = kwargs.get('transition')
|
||||||
update_state = transition is not None and transition > 3
|
update_state = transition is not None and transition > 3
|
||||||
|
_after = None
|
||||||
for item, value in kwargs.items():
|
for item, value in kwargs.items():
|
||||||
setattr(self, f'_{item}', value)
|
setattr(self, f'_{item}', value)
|
||||||
_after = self.get_rgbw()
|
if item == 'rgb_color':
|
||||||
|
_after = value
|
||||||
|
_after = _after or self.get_rgbw()
|
||||||
self._rgb_color = tuple(_after[:3])
|
self._rgb_color = tuple(_after[:3])
|
||||||
if transition is None:
|
if transition is None:
|
||||||
transition = self.smooth.total_seconds()
|
transition = self.smooth.total_seconds()
|
||||||
|
|||||||
Reference in New Issue
Block a user