From aad90b864494d38746fd47fb0784789552589a0f Mon Sep 17 00:00:00 2001 From: Robert Svensson Date: Tue, 8 Jun 2021 00:03:33 +0200 Subject: [PATCH] Use supported color modes in Axis integration (#51557) * Use supported color modes in Axis integration * Fix Frencks comments * Do Frencks suggestion --- homeassistant/components/axis/light.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/axis/light.py b/homeassistant/components/axis/light.py index e627d6ccdbd..17b48e7b232 100644 --- a/homeassistant/components/axis/light.py +++ b/homeassistant/components/axis/light.py @@ -4,7 +4,7 @@ from axis.event_stream import CLASS_LIGHT from homeassistant.components.light import ( ATTR_BRIGHTNESS, - SUPPORT_BRIGHTNESS, + COLOR_MODE_BRIGHTNESS, LightEntity, ) from homeassistant.core import callback @@ -49,7 +49,8 @@ class AxisLight(AxisEventBase, LightEntity): self.current_intensity = 0 self.max_intensity = 0 - self._features = SUPPORT_BRIGHTNESS + self._attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS} + self._attr_color_mode = COLOR_MODE_BRIGHTNESS async def async_added_to_hass(self) -> None: """Subscribe lights events.""" @@ -67,11 +68,6 @@ class AxisLight(AxisEventBase, LightEntity): ) self.max_intensity = max_intensity["data"]["ranges"][0]["high"] - @property - def supported_features(self): - """Flag supported features.""" - return self._features - @property def name(self): """Return the name of the light."""