mirror of
https://github.com/home-assistant/core.git
synced 2026-02-14 23:28:42 +00:00
Tweak
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user