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 GitHub
parent b220beb811
commit e17ca21a83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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