Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions homeassistant/components/zerproc/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
ColorMode,
LightEntity,
)
from homeassistant.config_entries import ConfigEntry
Expand All @@ -25,8 +24,6 @@

_LOGGER = logging.getLogger(__name__)

SUPPORT_ZERPROC = SUPPORT_BRIGHTNESS | SUPPORT_COLOR

DISCOVERY_INTERVAL = timedelta(seconds=60)


Expand Down Expand Up @@ -81,6 +78,9 @@ async def discover(*args):
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
Expand Down Expand Up @@ -131,11 +131,6 @@ def icon(self) -> str | None:
"""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."""
Expand Down
14 changes: 6 additions & 8 deletions tests/components/zerproc/test_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
ATTR_SUPPORTED_COLOR_MODES,
ATTR_XY_COLOR,
SCAN_INTERVAL,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
ColorMode,
)
from homeassistant.components.zerproc.const import (
Expand Down Expand Up @@ -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",
}

Expand All @@ -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,
Expand Down Expand Up @@ -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",
}

Expand All @@ -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",
}

Expand All @@ -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",
}

Expand All @@ -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,
Expand Down