wemo light brightness fixes (#53740)
This commit is contained in:
parent
2b2cddb5f0
commit
7ae158f9a1
1 changed files with 6 additions and 7 deletions
|
@ -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…
Add table
Reference in a new issue