Skip to content

Commit

Permalink
Overload __str__ in the device class (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
felipediel authored Nov 5, 2020
1 parent 1d81ebd commit 73dab5c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions broadlink/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ def __repr__(self):
"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(
Expand Down

0 comments on commit 73dab5c

Please sign in to comment.