diff --git a/homeassistant/components/zerproc/light.py b/homeassistant/components/zerproc/light.py index 0fa18197764..2ab4bc127c4 100644 --- a/homeassistant/components/zerproc/light.py +++ b/homeassistant/components/zerproc/light.py @@ -1,7 +1,7 @@ """Zerproc light platform.""" from datetime import timedelta import logging -from typing import Callable, List +from typing import Callable, List, Optional import pyzerproc @@ -142,6 +142,11 @@ class ZerprocLight(LightEntity): "manufacturer": "Zerproc", } + @property + def icon(self) -> Optional[str]: + """Return the icon to use in the frontend.""" + return "mdi:string-lights" + @property def supported_features(self): """Flag supported features.""" diff --git a/tests/components/zerproc/test_light.py b/tests/components/zerproc/test_light.py index 6d2598ae5a6..871f91d447c 100644 --- a/tests/components/zerproc/test_light.py +++ b/tests/components/zerproc/test_light.py @@ -16,6 +16,7 @@ from homeassistant.components.zerproc.light import DOMAIN from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_FRIENDLY_NAME, + ATTR_ICON, ATTR_SUPPORTED_FEATURES, STATE_OFF, STATE_ON, @@ -82,6 +83,7 @@ async def test_init(hass): assert state.attributes == { ATTR_FRIENDLY_NAME: "LEDBlue-CCDDEEFF", ATTR_SUPPORTED_FEATURES: SUPPORT_BRIGHTNESS | SUPPORT_COLOR, + ATTR_ICON: "mdi:string-lights", } state = hass.states.get("light.ledblue_33445566") @@ -89,6 +91,7 @@ async def test_init(hass): assert state.attributes == { ATTR_FRIENDLY_NAME: "LEDBlue-33445566", ATTR_SUPPORTED_FEATURES: SUPPORT_BRIGHTNESS | SUPPORT_COLOR, + ATTR_ICON: "mdi:string-lights", ATTR_BRIGHTNESS: 255, ATTR_HS_COLOR: (221.176, 100.0), ATTR_RGB_COLOR: (0, 80, 255), @@ -260,6 +263,7 @@ async def test_light_update(hass, mock_light): assert state.attributes == { ATTR_FRIENDLY_NAME: "LEDBlue-CCDDEEFF", ATTR_SUPPORTED_FEATURES: SUPPORT_BRIGHTNESS | SUPPORT_COLOR, + ATTR_ICON: "mdi:string-lights", } # Make sure no discovery calls are made while we emulate time passing @@ -277,6 +281,7 @@ async def test_light_update(hass, mock_light): assert state.attributes == { ATTR_FRIENDLY_NAME: "LEDBlue-CCDDEEFF", ATTR_SUPPORTED_FEATURES: SUPPORT_BRIGHTNESS | SUPPORT_COLOR, + ATTR_ICON: "mdi:string-lights", } with patch.object( @@ -293,6 +298,7 @@ async def test_light_update(hass, mock_light): assert state.attributes == { ATTR_FRIENDLY_NAME: "LEDBlue-CCDDEEFF", ATTR_SUPPORTED_FEATURES: SUPPORT_BRIGHTNESS | SUPPORT_COLOR, + ATTR_ICON: "mdi:string-lights", } with patch.object( @@ -309,6 +315,7 @@ async def test_light_update(hass, mock_light): assert state.attributes == { ATTR_FRIENDLY_NAME: "LEDBlue-CCDDEEFF", ATTR_SUPPORTED_FEATURES: SUPPORT_BRIGHTNESS | SUPPORT_COLOR, + ATTR_ICON: "mdi:string-lights", ATTR_BRIGHTNESS: 220, ATTR_HS_COLOR: (261.429, 31.818), ATTR_RGB_COLOR: (202, 173, 255),