From 8694f747184eb1e207691210c15f846442c5b2b1 Mon Sep 17 00:00:00 2001 From: Thibault Cohen <47721+titilambert@users.noreply.github.com> Date: Sat, 11 May 2024 12:53:28 -0400 Subject: [PATCH] Fix turn on/off call --- custom_components/chihiros/light.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/chihiros/light.py b/custom_components/chihiros/light.py index 82913d3..c82fa83 100644 --- a/custom_components/chihiros/light.py +++ b/custom_components/chihiros/light.py @@ -125,7 +125,7 @@ async def async_turn_on(self, **kwargs: Any) -> None: self._attr_brightness = kwargs[ATTR_BRIGHTNESS] else: _LOGGER.debug("Turning on: %s", self.name) - await self._device.turn_on() + await self._device.set_color_brightness(100, self._color) self._attr_is_on = True self._attr_available = True self.schedule_update_ha_state() @@ -135,7 +135,7 @@ async def async_turn_off(self, **kwargs: Any) -> None: """Instruct the light to turn off.""" _LOGGER.debug("Turning off: %s", self.name) # TODO handle error and availability False - await self._device.turn_off() + await self._device.set_color_brightness(0, self._color) self._attr_is_on = False self._attr_brightness = 0 self._attr_available = True