Skip to content

Commit

Permalink
Fix turn on mesh light on brightness or color_temp commands #1459
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Nov 12, 2024
1 parent 98e231f commit a96b6d6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom_components/xiaomi_gateway3/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ def get_state(self) -> dict:
}

async def async_turn_on(self, **kwargs):
self.device.write(kwargs if kwargs else {self.attr: True})
# https://github.com/AlexxIT/XiaomiGateway3/issues/1459
if not self._attr_is_on or not kwargs:
kwargs[self.attr] = True
self.device.write(kwargs)

async def async_turn_off(self, **kwargs):
self.device.write({self.attr: False})
Expand Down

0 comments on commit a96b6d6

Please sign in to comment.