1
0
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:
Matthew Garrett 2020-11-07 11:19:17 -08:00 committed by GitHub
commit 1799a8c8cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

@ -143,6 +143,13 @@ class device:
"Locked" if self.is_locked else "Unlocked", "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: def update_aes(self, key: bytes) -> None:
"""Update AES.""" """Update AES."""
self.aes = Cipher( self.aes = Cipher(

View File

@ -218,10 +218,7 @@ class sp2(device):
response = self.send_packet(0x6A, packet) response = self.send_packet(0x6A, packet)
check_error(response[0x22:0x24]) check_error(response[0x22:0x24])
payload = self.decrypt(response[0x38:]) payload = self.decrypt(response[0x38:])
return ( return int((payload[0x07] + payload[0x06] / 100) * 100) + payload[0x05] / 100
int(hex(payload[0x07] * 256 + payload[0x06])[2:])
+ int(hex(payload[0x05])[2:]) / 100.0
)
class sp4(device): class sp4(device):

View File

@ -5,7 +5,7 @@
from setuptools import setup, find_packages from setuptools import setup, find_packages
version = "0.15.0" version = '0.16.0'
setup( setup(
name="broadlink", name="broadlink",