Fix Nanoleaf light turn_off transition (#57305)

This commit is contained in:
Milan Meulemans 2021-10-08 18:02:01 +02:00 committed by Paulus Schoutsen
parent c6d506cb4f
commit 1a78c461a0

View File

@ -168,8 +168,8 @@ class NanoleafLight(LightEntity):
async def async_turn_off(self, **kwargs): async def async_turn_off(self, **kwargs):
"""Instruct the light to turn off.""" """Instruct the light to turn off."""
transition = kwargs.get(ATTR_TRANSITION) transition: float | None = kwargs.get(ATTR_TRANSITION)
await self._nanoleaf.turn_off(transition) await self._nanoleaf.turn_off(None if transition is None else int(transition))
async def async_update(self) -> None: async def async_update(self) -> None:
"""Fetch new state data for this light.""" """Fetch new state data for this light."""