mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 01:07:10 +00:00
Fix Shelly RGB/W supported color mode detection (#57359)
This commit is contained in:
parent
fe3b5e8804
commit
722d3862db
@ -21,6 +21,11 @@ LIGHT_TRANSITION_MIN_FIRMWARE_DATE: Final = 20210226
|
||||
# max light transition time in milliseconds
|
||||
MAX_TRANSITION_TIME: Final = 5000
|
||||
|
||||
RGBW_MODELS: Final = (
|
||||
"SHBLB-1",
|
||||
"SHRGBW2",
|
||||
)
|
||||
|
||||
MODELS_SUPPORTING_LIGHT_TRANSITION: Final = (
|
||||
"SHBDUO-1",
|
||||
"SHCB-1",
|
||||
|
@ -46,6 +46,7 @@ from .const import (
|
||||
LIGHT_TRANSITION_MIN_FIRMWARE_DATE,
|
||||
MAX_TRANSITION_TIME,
|
||||
MODELS_SUPPORTING_LIGHT_TRANSITION,
|
||||
RGBW_MODELS,
|
||||
RPC,
|
||||
SHBLB_1_RGB_EFFECTS,
|
||||
STANDARD_RGB_EFFECTS,
|
||||
@ -143,7 +144,7 @@ class BlockShellyLight(ShellyBlockEntity, LightEntity):
|
||||
|
||||
if hasattr(block, "red") and hasattr(block, "green") and hasattr(block, "blue"):
|
||||
self._min_kelvin = KELVIN_MIN_VALUE_COLOR
|
||||
if hasattr(block, "white"):
|
||||
if wrapper.model in RGBW_MODELS:
|
||||
self._supported_color_modes.add(COLOR_MODE_RGBW)
|
||||
else:
|
||||
self._supported_color_modes.add(COLOR_MODE_RGB)
|
||||
|
Loading…
x
Reference in New Issue
Block a user