1
0
mirror of https://github.com/mjg59/python-broadlink.git synced 2024-11-10 18:00:12 +01:00

Overload __str__ in the device class (#468)

This commit is contained in:
Felipe Martins Diel 2020-11-05 16:19:03 -03:00 committed by GitHub
parent 1d81ebd1d0
commit 73dab5c3d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,6 +143,13 @@ class device:
"Locked" if self.is_locked else "Unlocked",
)
def __str__(self):
return "%s (%s at %s)" % (
self.name,
self.model or hex(self.devtype),
self.host[0],
)
def update_aes(self, key: bytes) -> None:
"""Update AES."""
self.aes = Cipher(