Skip to content

Commit

Permalink
fix supported features magic number and add color_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dwradcliffe committed Apr 26, 2024
1 parent 843dc58 commit 63fc468
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions custom_components/intellicenter/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ async def async_setup_entry(
class PoolLight(PoolEntity, LightEntity):
"""Representation of an Pentair light."""

_attr_color_mode = ColorMode.ONOFF
_attr_supported_color_modes = {ColorMode.ONOFF}
_attr_supported_features = LightEntityFeature(0)

def __init__(
self,
Expand All @@ -96,20 +98,13 @@ def __init__(
# USE appears to contain extra info like color...
self._extra_state_attributes = [USE_ATTR]

self._features = 0

self._lightEffects = colorEffects
self._reversedLightEffects = (
dict(map(reversed, colorEffects.items())) if colorEffects else None
)

if self._lightEffects:
self._features |= LightEntityFeature.EFFECT

@property
def supported_features(self) -> int:
"""Return supported features."""
return self._features
self._attr_supported_features |= LightEntityFeature.EFFECT

@property
def effect_list(self) -> list:
Expand Down

0 comments on commit 63fc468

Please sign in to comment.