1
0
mirror of https://github.com/home-assistant/core.git synced 2026-02-14 23:28:42 +00:00
This commit is contained in:
epenet
2026-02-09 13:56:14 +00:00
parent 7dfa02e6c1
commit c665a844d6
2 changed files with 2 additions and 5 deletions

View File

@@ -89,8 +89,5 @@ class DeakoLightEntity(LightEntity):
assert self._attr_unique_id is not None
state = self.client.get_state(self._attr_unique_id) or {}
self._attr_is_on = bool(state.get("power", False))
if (
self._attr_supported_color_modes is not None
and ColorMode.BRIGHTNESS in self._attr_supported_color_modes
):
if ColorMode.BRIGHTNESS in self._attr_supported_color_modes:
self._attr_brightness = int(round(state.get("dim", 0) * 2.55))

View File

@@ -332,7 +332,7 @@ class MatterLight(MatterEntity, LightEntity):
@callback
def _update_from_device(self) -> None:
"""Update from device."""
if self._attr_supported_color_modes is None:
if not hasattr(self, "_attr_supported_color_modes"):
# work out what (color)features are supported
supported_color_modes = {ColorMode.ONOFF}
# brightness support