forked from home-assistant/core
wemo light brightness fixes (#53740)
This commit is contained in:
@@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user