Improve type hints in lw12wifi light (#77656)

pull/77609/head
epenet 2022-09-06 20:00:51 +02:00 committed by GitHub
parent 759f12bcda
commit 5632e33426
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -116,7 +116,7 @@ class LW12WiFi(LightEntity):
"""Return True if unable to access real state of the entity.""" """Return True if unable to access real state of the entity."""
return True return True
def turn_on(self, **kwargs): def turn_on(self, **kwargs: Any) -> None:
"""Instruct the light to turn on.""" """Instruct the light to turn on."""
self._light.light_on() self._light.light_on()
if ATTR_HS_COLOR in kwargs: if ATTR_HS_COLOR in kwargs:
@ -124,7 +124,7 @@ class LW12WiFi(LightEntity):
self._light.set_color(*self._rgb_color) self._light.set_color(*self._rgb_color)
self._effect = None self._effect = None
if ATTR_BRIGHTNESS in kwargs: if ATTR_BRIGHTNESS in kwargs:
self._brightness = kwargs.get(ATTR_BRIGHTNESS) self._brightness = kwargs[ATTR_BRIGHTNESS]
brightness = int(self._brightness / 255 * 100) brightness = int(self._brightness / 255 * 100)
self._light.set_light_option(lw12.LW12_LIGHT.BRIGHTNESS, brightness) self._light.set_light_option(lw12.LW12_LIGHT.BRIGHTNESS, brightness)
if ATTR_EFFECT in kwargs: if ATTR_EFFECT in kwargs: