From a97d2c92bbba415dbd948cfb1ec7869036073848 Mon Sep 17 00:00:00 2001 From: Steven B <51370195+sdb9696@users.noreply.github.com> Date: Wed, 17 Jul 2024 08:28:11 +0100 Subject: [PATCH] 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. --- kasa/smart/modules/lighteffect.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kasa/smart/modules/lighteffect.py b/kasa/smart/modules/lighteffect.py index 5f589d6d..699c679b 100644 --- a/kasa/smart/modules/lighteffect.py +++ b/kasa/smart/modules/lighteffect.py @@ -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,