Fix Shelly RGB/W supported color mode detection (#57359)

This commit is contained in:
Shay Levy 2021-10-09 02:22:14 +03:00 committed by GitHub
parent fe3b5e8804
commit 722d3862db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -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",

View File

@ -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)