mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Add reboot and factory_reset to tapodevice (#686)
* Add reboot and factory_reset to tapodevice * Add test for reboot command * Fix mocking as different protocols use different methods for comms..
This commit is contained in:
@@ -339,3 +339,18 @@ class TapoDevice(SmartDevice):
|
||||
"time": t,
|
||||
}
|
||||
return await self.protocol.query({"set_qs_info": payload})
|
||||
|
||||
async def reboot(self, delay: int = 1) -> None:
|
||||
"""Reboot the device.
|
||||
|
||||
Note that giving a delay of zero causes this to block,
|
||||
as the device reboots immediately without responding to the call.
|
||||
"""
|
||||
await self.protocol.query({"device_reboot": {"delay": delay}})
|
||||
|
||||
async def factory_reset(self) -> None:
|
||||
"""Reset device back to factory settings.
|
||||
|
||||
Note, this does not downgrade the firmware.
|
||||
"""
|
||||
await self.protocol.query("device_reset")
|
||||
|
Reference in New Issue
Block a user