Only refresh smart LightEffect module daily (#1064)

Fixes an issue with L530 bulbs on HW version 1.0 whereby the light effect
query causes the device to crash with JSON_ENCODE_FAIL_ERROR after
approximately 60 calls.
This commit is contained in:
Steven B 2024-07-17 08:28:11 +01:00 committed by sdb9696
parent 448efd7e4c
commit a97d2c92bb
No known key found for this signature in database
GPG Key ID: D31806353346E25D

View File

@ -17,7 +17,7 @@ class LightEffect(SmartModule, SmartLightEffect):
REQUIRED_COMPONENT = "light_effect" REQUIRED_COMPONENT = "light_effect"
QUERY_GETTER_NAME = "get_dynamic_light_effect_rules" QUERY_GETTER_NAME = "get_dynamic_light_effect_rules"
MINIMUM_UPDATE_INTERVAL_SECS = 60 MINIMUM_UPDATE_INTERVAL_SECS = 60 * 60 * 24
AVAILABLE_BULB_EFFECTS = { AVAILABLE_BULB_EFFECTS = {
"L1": "Party", "L1": "Party",
"L2": "Relax", "L2": "Relax",
@ -74,6 +74,7 @@ class LightEffect(SmartModule, SmartLightEffect):
"""Return effect name.""" """Return effect name."""
return self._effect return self._effect
@allow_update_after
async def set_effect( async def set_effect(
self, self,
effect: str, effect: str,