8000 Add inactivity setting for the motion module (#453) · python-kasa/python-kasa@18ce40b · GitHub
[go: up one dir, main page]

Skip to content

Commit 18ce40b

Browse files
rytilahtiwhitslack
andauthored
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>
1 parent ce5821a commit 18ce40b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

kasa/modules/motion.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,16 @@ async def set_range(
5959
)
6060

6161
return await self.call("set_trigger_sens", payload)
62+
63+
@property
64+
def inactivity_timeout(self) -> int:
65+
"""Return inactivity timeout in milliseconds."""
66+
return self.data["cold_time"]
67+
68+
async def set_inactivity_timeout(self, timeout: int):
69+
"""Set inactivity timeout in milliseconds.
70+
71+
Note, that you need to delete the default "Smart Control" rule in the app
72+
to avoid reverting this back to 60 seconds after a period of time.
73+
"""
74+
return await self.call("set_cold_time", {"cold_time": timeout})

0 commit comments

Comments
 (0)
0