Skip to content

Commit

Permalink
fix: fix light supported_features return value
Browse files Browse the repository at this point in the history
  • Loading branch information
muhlba91 committed Dec 12, 2023
1 parent 891a124 commit f3af412
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion custom_components/hella_onyx/sensors/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from homeassistant.components.light import (
LightEntity,
ColorMode,
LightEntityFeature,
ATTR_BRIGHTNESS,
)
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
Expand Down Expand Up @@ -55,7 +56,7 @@ def unique_id(self) -> str:
@property
def supported_features(self):
"""Flag supported features."""
return []
return LightEntityFeature(0)

@property
def color_mode(self) -> ColorMode | str | None:
Expand Down
2 changes: 1 addition & 1 deletion tests/sensors/test_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_unique_id(self, entity):
assert entity.unique_id == "uuid/Light"

def test_supported_features(self, entity):
assert len(entity.supported_features) == 0
assert entity.supported_features == 0

def test_color_mode(self, api, entity, device):
device.device_type = DeviceType.BASIC_LIGHT
Expand Down

0 comments on commit f3af412

Please sign in to comment.