mirror of
				https://github.com/python-kasa/python-kasa.git
				synced 2025-11-04 06:32:07 +00:00 
			
		
		
		
	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:
		@@ -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,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user