mirror of
https://github.com/mjg59/python-broadlink.git
synced 2024-11-22 15:10:12 +01:00
Merge branch 'master' into patch-2
This commit is contained in:
commit
1799a8c8cf
@ -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(
|
||||
|
@ -218,10 +218,7 @@ class sp2(device):
|
||||
response = self.send_packet(0x6A, packet)
|
||||
check_error(response[0x22:0x24])
|
||||
payload = self.decrypt(response[0x38:])
|
||||
return (
|
||||
int(hex(payload[0x07] * 256 + payload[0x06])[2:])
|
||||
+ int(hex(payload[0x05])[2:]) / 100.0
|
||||
)
|
||||
return int((payload[0x07] + payload[0x06] / 100) * 100) + payload[0x05] / 100
|
||||
|
||||
|
||||
class sp4(device):
|
||||
|
Loading…
Reference in New Issue
Block a user