Skip to content

Commit

Permalink
Merge pull request #20 from titilambert/ha_fix_turn_onoff
Browse files Browse the repository at this point in the history
Fix HA integration turn on/off
  • Loading branch information
TheMicDiet committed May 12, 2024
2 parents 83753a8 + 8694f74 commit 133b34b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/chihiros/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit 133b34b

Please sign in to comment.