From 52a424cd239953c0b0f1a4da1403380470038e61 Mon Sep 17 00:00:00 2001 From: Pedro Ribeiro Date: Tue, 15 Oct 2024 21:25:11 +0000 Subject: [PATCH] ZigBee lights not shown in Home Assistant Fixes #134 --- custom_components/rademacher/light.py | 9 +++++++-- custom_components/rademacher/manifest.json | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/custom_components/rademacher/light.py b/custom_components/rademacher/light.py index c54ef6c..25bd02c 100644 --- a/custom_components/rademacher/light.py +++ b/custom_components/rademacher/light.py @@ -98,11 +98,13 @@ 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): @@ -110,7 +112,10 @@ def color_mode(self): 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): diff --git a/custom_components/rademacher/manifest.json b/custom_components/rademacher/manifest.json index 6f8622f..0364d42 100644 --- a/custom_components/rademacher/manifest.json +++ b/custom_components/rademacher/manifest.json @@ -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" }