From 69dcc0d8bb216d6d7141e3bf0a961f1959f68f6d Mon Sep 17 00:00:00 2001 From: Teemu R Date: Mon, 29 Jan 2024 11:57:32 +0100 Subject: [PATCH] Implement alias set for tapodevice (#721) --- kasa/tapo/tapodevice.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kasa/tapo/tapodevice.py b/kasa/tapo/tapodevice.py index 86967b69..9edcca86 100644 --- a/kasa/tapo/tapodevice.py +++ b/kasa/tapo/tapodevice.py @@ -340,6 +340,12 @@ class TapoDevice(SmartDevice): } return await self.protocol.query({"set_qs_info": payload}) + async def set_alias(self, alias: str): + """Set the device name (alias).""" + return await self.protocol.query( + {"set_device_info": {"nickname": base64.b64encode(alias.encode()).decode()}} + ) + async def reboot(self, delay: int = 1) -> None: """Reboot the device.