mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +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 light transition time in milliseconds
|
||||||
MAX_TRANSITION_TIME: Final = 5000
|
MAX_TRANSITION_TIME: Final = 5000
|
||||||
|
|
||||||
|
RGBW_MODELS: Final = (
|
||||||
|
"SHBLB-1",
|
||||||
|
"SHRGBW2",
|
||||||
|
)
|
||||||
|
|
||||||
MODELS_SUPPORTING_LIGHT_TRANSITION: Final = (
|
MODELS_SUPPORTING_LIGHT_TRANSITION: Final = (
|
||||||
"SHBDUO-1",
|
"SHBDUO-1",
|
||||||
"SHCB-1",
|
"SHCB-1",
|
||||||
|
@ -46,6 +46,7 @@ from .const import (
|
|||||||
LIGHT_TRANSITION_MIN_FIRMWARE_DATE,
|
LIGHT_TRANSITION_MIN_FIRMWARE_DATE,
|
||||||
MAX_TRANSITION_TIME,
|
MAX_TRANSITION_TIME,
|
||||||
MODELS_SUPPORTING_LIGHT_TRANSITION,
|
MODELS_SUPPORTING_LIGHT_TRANSITION,
|
||||||
|
RGBW_MODELS,
|
||||||
RPC,
|
RPC,
|
||||||
SHBLB_1_RGB_EFFECTS,
|
SHBLB_1_RGB_EFFECTS,
|
||||||
STANDARD_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"):
|
if hasattr(block, "red") and hasattr(block, "green") and hasattr(block, "blue"):
|
||||||
self._min_kelvin = KELVIN_MIN_VALUE_COLOR
|
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)
|
self._supported_color_modes.add(COLOR_MODE_RGBW)
|
||||||
else:
|
else:
|
||||||
self._supported_color_modes.add(COLOR_MODE_RGB)
|
self._supported_color_modes.add(COLOR_MODE_RGB)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user