Fix Nanoleaf light turn_off transition (#57305)

This commit is contained in:
Milan Meulemans 2021-10-08 18:02:01 +02:00 committed by GitHub
parent c04be4f5d0
commit 4dafd42154
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -182,8 +182,8 @@ class NanoleafLight(LightEntity):
async def async_turn_off(self, **kwargs: Any) -> None: async def async_turn_off(self, **kwargs: Any) -> None:
"""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."""