diff --git a/custom_components/xiaomi_gateway3/light.py b/custom_components/xiaomi_gateway3/light.py index fcb74154..8698ce1d 100644 --- a/custom_components/xiaomi_gateway3/light.py +++ b/custom_components/xiaomi_gateway3/light.py @@ -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})