Implement alias set for tapodevice (#721)

This commit is contained in:
Teemu R 2024-01-29 11:57:32 +01:00 committed by GitHub
parent 9c0a831027
commit 69dcc0d8bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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.