mirror of
https://github.com/home-assistant/core.git
synced 2025-07-07 13:27:09 +00:00
Fix Netatmo light switching states by assuming state until next update (#106162)
This commit is contained in:
parent
0beb47ac2c
commit
5ab41c40a6
@ -186,11 +186,6 @@ class NetatmoLight(NetatmoBase, LightEntity):
|
||||
]
|
||||
)
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool:
|
||||
"""Return true if light is on."""
|
||||
return self._dimmer.on is True
|
||||
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
"""Turn light on."""
|
||||
if ATTR_BRIGHTNESS in kwargs:
|
||||
@ -211,6 +206,8 @@ class NetatmoLight(NetatmoBase, LightEntity):
|
||||
@callback
|
||||
def async_update_callback(self) -> None:
|
||||
"""Update the entity's state."""
|
||||
self._attr_is_on = self._dimmer.on is True
|
||||
|
||||
if self._dimmer.brightness is not None:
|
||||
# Netatmo uses a range of [0, 100] to control brightness
|
||||
self._attr_brightness = round((self._dimmer.brightness / 100) * 255)
|
||||
|
Loading…
x
Reference in New Issue
Block a user