8000 Add reboot() to the device interface (#1124) · python-kasa/python-kasa@f07341a · GitHub
[go: up one dir, main page]

Skip to content

Commit f07341a

Browse files
authored
Add reboot() to the device interface (#1124)
Both device families have already had a method following this signature, but defining the interface in the base class will make the contract clear.
1 parent 5df6c76 commit f07341a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

kasa/device.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,14 @@ async def wifi_join(self, ssid: str, password: str, keytype: str = "wpa2_psk"):
449449
async def set_alias(self, alias: str):
450450
"""Set the device name (alias)."""
451451

452+
@abstractmethod
453+
async def reboot(self, delay: int = 1) -> None:
454+
"""Reboot the device.
455+
456+
Note that giving a delay of zero causes this to block,
457+
as the device reboots immediately without responding to the call.
458+
"""
459+
452460
def __repr__(self):
453461
if self._last_update is None:
454462
return f"<{self.device_type} at {self.host} - update() needed>"

0 commit comments

Comments
 (0)
0