diff --git a/homeassistant/components/zerproc/light.py b/homeassistant/components/zerproc/light.py index bc9b3cae410..9bc2e4d29f3 100644 --- a/homeassistant/components/zerproc/light.py +++ b/homeassistant/components/zerproc/light.py @@ -9,8 +9,7 @@ import pyzerproc from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_HS_COLOR, - SUPPORT_BRIGHTNESS, - SUPPORT_COLOR, + ColorMode, LightEntity, ) from homeassistant.config_entries import ConfigEntry @@ -25,8 +24,6 @@ from .const import DATA_ADDRESSES, DATA_DISCOVERY_SUBSCRIPTION, DOMAIN _LOGGER = logging.getLogger(__name__) -SUPPORT_ZERPROC = SUPPORT_BRIGHTNESS | SUPPORT_COLOR - DISCOVERY_INTERVAL = timedelta(seconds=60) @@ -81,6 +78,9 @@ async def async_setup_entry( class ZerprocLight(LightEntity): """Representation of an Zerproc Light.""" + _attr_color_mode = ColorMode.HS + _attr_supported_color_modes = {ColorMode.HS} + def __init__(self, light): """Initialize a Zerproc light.""" self._light = light @@ -131,11 +131,6 @@ class ZerprocLight(LightEntity): """Return the icon to use in the frontend.""" return "mdi:string-lights" - @property - def supported_features(self): - """Flag supported features.""" - return SUPPORT_ZERPROC - @property def brightness(self): """Return the brightness of the light.""" diff --git a/tests/components/zerproc/test_light.py b/tests/components/zerproc/test_light.py index 59fba0da963..36c3080f384 100644 --- a/tests/components/zerproc/test_light.py +++ b/tests/components/zerproc/test_light.py @@ -12,8 +12,6 @@ from homeassistant.components.light import ( ATTR_SUPPORTED_COLOR_MODES, ATTR_XY_COLOR, SCAN_INTERVAL, - SUPPORT_BRIGHTNESS, - SUPPORT_COLOR, ColorMode, ) from homeassistant.components.zerproc.const import ( @@ -101,7 +99,7 @@ async def test_init(hass, mock_entry): assert state.attributes == { ATTR_FRIENDLY_NAME: "LEDBlue-CCDDEEFF", ATTR_SUPPORTED_COLOR_MODES: [ColorMode.HS], - ATTR_SUPPORTED_FEATURES: SUPPORT_BRIGHTNESS | SUPPORT_COLOR, + ATTR_SUPPORTED_FEATURES: 0, ATTR_ICON: "mdi:string-lights", } @@ -110,7 +108,7 @@ async def test_init(hass, mock_entry): assert state.attributes == { ATTR_FRIENDLY_NAME: "LEDBlue-33445566", ATTR_SUPPORTED_COLOR_MODES: [ColorMode.HS], - ATTR_SUPPORTED_FEATURES: SUPPORT_BRIGHTNESS | SUPPORT_COLOR, + ATTR_SUPPORTED_FEATURES: 0, ATTR_ICON: "mdi:string-lights", ATTR_COLOR_MODE: ColorMode.HS, ATTR_BRIGHTNESS: 255, @@ -280,7 +278,7 @@ async def test_light_update(hass, mock_light): assert state.attributes == { ATTR_FRIENDLY_NAME: "LEDBlue-CCDDEEFF", ATTR_SUPPORTED_COLOR_MODES: [ColorMode.HS], - ATTR_SUPPORTED_FEATURES: SUPPORT_BRIGHTNESS | SUPPORT_COLOR, + ATTR_SUPPORTED_FEATURES: 0, ATTR_ICON: "mdi:string-lights", } @@ -299,7 +297,7 @@ async def test_light_update(hass, mock_light): assert state.attributes == { ATTR_FRIENDLY_NAME: "LEDBlue-CCDDEEFF", ATTR_SUPPORTED_COLOR_MODES: [ColorMode.HS], - ATTR_SUPPORTED_FEATURES: SUPPORT_BRIGHTNESS | SUPPORT_COLOR, + ATTR_SUPPORTED_FEATURES: 0, ATTR_ICON: "mdi:string-lights", } @@ -317,7 +315,7 @@ async def test_light_update(hass, mock_light): assert state.attributes == { ATTR_FRIENDLY_NAME: "LEDBlue-CCDDEEFF", ATTR_SUPPORTED_COLOR_MODES: [ColorMode.HS], - ATTR_SUPPORTED_FEATURES: SUPPORT_BRIGHTNESS | SUPPORT_COLOR, + ATTR_SUPPORTED_FEATURES: 0, ATTR_ICON: "mdi:string-lights", } @@ -335,7 +333,7 @@ async def test_light_update(hass, mock_light): assert state.attributes == { ATTR_FRIENDLY_NAME: "LEDBlue-CCDDEEFF", ATTR_SUPPORTED_COLOR_MODES: [ColorMode.HS], - ATTR_SUPPORTED_FEATURES: SUPPORT_BRIGHTNESS | SUPPORT_COLOR, + ATTR_SUPPORTED_FEATURES: 0, ATTR_ICON: "mdi:string-lights", ATTR_COLOR_MODE: ColorMode.HS, ATTR_BRIGHTNESS: 220,