Add reboot command to restart the device (#129)

This commit is contained in:
Teemu R
2018-09-08 16:11:58 +02:00
committed by GitHub
parent d72b47c0b7
commit 345216e245
2 changed files with 19 additions and 0 deletions

View File

@@ -513,6 +513,17 @@ class SmartDevice(object):
response = EmeterStatus(self.get_emeter_realtime())
return response['power']
def reboot(self, delay=1) -> None:
"""
Reboot the device.
:param delay: Delay the reboot for `delay` seconds.
:return: None
Note that giving a delay of zero causes this to block.
"""
self._query_helper("system", "reboot", {"delay": delay})
def turn_off(self) -> None:
"""
Turns the device off.