mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
wemo light brightness fixes (#53740)
This commit is contained in:
parent
2b2cddb5f0
commit
7ae158f9a1
@ -229,14 +229,13 @@ class WemoDimmer(WemoSubscriptionEntity, LightEntity):
|
||||
if ATTR_BRIGHTNESS in kwargs:
|
||||
brightness = kwargs[ATTR_BRIGHTNESS]
|
||||
brightness = int((brightness / 255) * 100)
|
||||
else:
|
||||
brightness = 255
|
||||
|
||||
with self._wemo_exception_handler("turn on"):
|
||||
if self.wemo.on():
|
||||
with self._wemo_exception_handler("set brightness"):
|
||||
self.wemo.set_brightness(brightness)
|
||||
self._state = WEMO_ON
|
||||
else:
|
||||
with self._wemo_exception_handler("turn on"):
|
||||
self.wemo.on()
|
||||
self._state = WEMO_ON
|
||||
|
||||
self.wemo.set_brightness(brightness)
|
||||
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user