mirror of
				https://github.com/python-kasa/python-kasa.git
				synced 2025-11-04 06:32:07 +00:00 
			
		
		
		
	Add inactivity setting for the motion module (#453)
* Add inactivity setting for the motion module * Fix set_cold_time payload Co-authored-by: Matt Whitlock <whitslack@users.noreply.github.com> * Add mention about "smart control" --------- Co-authored-by: Matt Whitlock <whitslack@users.noreply.github.com>
This commit is contained in:
		@@ -59,3 +59,16 @@ class Motion(Module):
 | 
			
		||||
            )
 | 
			
		||||
 | 
			
		||||
        return await self.call("set_trigger_sens", payload)
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def inactivity_timeout(self) -> int:
 | 
			
		||||
        """Return inactivity timeout in milliseconds."""
 | 
			
		||||
        return self.data["cold_time"]
 | 
			
		||||
 | 
			
		||||
    async def set_inactivity_timeout(self, timeout: int):
 | 
			
		||||
        """Set inactivity timeout in milliseconds.
 | 
			
		||||
 | 
			
		||||
        Note, that you need to delete the default "Smart Control" rule in the app
 | 
			
		||||
        to avoid reverting this back to 60 seconds after a period of time.
 | 
			
		||||
        """
 | 
			
		||||
        return await self.call("set_cold_time", {"cold_time": timeout})
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user