Improve type hints in lw12wifi light (#77656)
parent
759f12bcda
commit
5632e33426
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue