Skip to content

Commit

Permalink
Merge pull request #135 from peribeir/peribeir/issue134
Browse files Browse the repository at this point in the history
ZigBee lights not shown in Home Assistant
  • Loading branch information
peribeir authored Oct 15, 2024
2 parents f41049b + 52a424c commit 59a7ba0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions custom_components/rademacher/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,24 @@ def __init__(
unique_id=light.uid,
name=light.name,
)
self._attr_supported_color_modes = {ColorMode.BRIGHTNESS}
self._attr_supported_color_modes = set()
if light.has_rgb:
self._attr_supported_color_modes.add(ColorMode.RGB)
if light.has_color_temp:
self._attr_supported_color_modes.add(ColorMode.COLOR_TEMP)
if not light.has_rgb and not light.has_color_temp:
self._attr_supported_color_modes.add(ColorMode.BRIGHTNESS)

@property
def color_mode(self):
device: HomePilotLight = self.coordinator.data[self.did]
if device.has_color_mode:
return ColorMode.COLOR_TEMP if device.color_mode_value == "ct" else ColorMode.RGB
else:
return ColorMode.UNKNOWN
if not device.has_rgb and not device.has_color_temp:
return ColorMode.BRIGHTNESS
else:
return ColorMode.UNKNOWN

@property
def brightness(self):
Expand Down
4 changes: 2 additions & 2 deletions custom_components/rademacher/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"integration_type": "hub",
"iot_class": "local_polling",
"issue_tracker": "https://github.com/peribeir/homeassistant-rademacher/issues",
"requirements": ["pyrademacher==0.14.1", "asyncio>=3.4.3"],
"version": "2.2.0"
"requirements": ["pyrademacher==0.14.3", "asyncio>=3.4.3"],
"version": "2.2.1"
}

0 comments on commit 59a7ba0

Please sign in to comment.