Fix Shelly dual mode bulb mode switch (#60471)

* fix_shelly_dual_mode_bulb_mode_switch

* Update __init__.py

* Update light.py
This commit is contained in:
Gábor Kiss
2021-11-28 11:07:18 +01:00
committed by GitHub
parent 6d08bee3df
commit 1aadda4b0f

View File

@@ -366,7 +366,11 @@ class BlockShellyLight(ShellyBlockEntity, LightEntity):
self.wrapper.model,
)
if set_mode and self.wrapper.model in DUAL_MODE_LIGHT_MODELS:
if (
set_mode
and set_mode != self.mode
and self.wrapper.model in DUAL_MODE_LIGHT_MODELS
):
params["mode"] = set_mode
self.control_result = await self.set_state(**params)