mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +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:
parent
ce5821a35f
commit
18ce40b6bb
@ -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})
|
||||
|
Loading…
Reference in New Issue
Block a user