Skip to content

Commit

Permalink
Set color mode for LightSwitch
Browse files Browse the repository at this point in the history
Bumped to boschshcpy==0.2.94
  • Loading branch information
tschamm committed Oct 3, 2024
1 parent 9ecfa62 commit c804fb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions custom_components/bosch_shc/light.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Platform for light integration."""

from boschshcpy import SHCSession
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
Expand Down Expand Up @@ -50,10 +51,13 @@ class LightSwitch(SHCEntity, LightEntity):
def __init__(self, device, parent_id, entry_id) -> None:
super().__init__(device=device, parent_id=parent_id, entry_id=entry_id)
self._supported_color_modes: set[ColorMode | str] = set()
self._attr_color_mode = ColorMode.BRIGHTNESS
if self._device.supports_color_hsb:
self._supported_color_modes.add(ColorMode.HS)
self._attr_color_mode = ColorMode.HS
if self._device.supports_color_temp:
self._supported_color_modes.add(ColorMode.COLOR_TEMP)
self._attr_color_mode = ColorMode.COLOR_TEMP
if self._device.supports_brightness:
if len(self._supported_color_modes) == 0:
# only add color mode brightness if no color variants
Expand Down
2 changes: 1 addition & 1 deletion custom_components/bosch_shc/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"documentation": "https://github.com/tschamm/boschshc-hass/blob/master/README.md",
"iot_class": "local_push",
"issue_tracker": "https://github.com/tschamm/boschshc-hass/issues",
"requirements": ["boschshcpy==0.2.92"],
"requirements": ["boschshcpy==0.2.94"],
"version": "0.4.90",
"zeroconf": [{ "type": "_http._tcp.local.", "name": "bosch shc*" }]
}

0 comments on commit c804fb0

Please sign in to comment.