mirror of
https://github.com/mjg59/python-broadlink.git
synced 2024-11-21 22:51:41 +01:00
Add method for obtaining the firmware version (#379)
* Add method for obtaining firmware version * Use hex notation for bytes Co-authored-by: Daniel Høyer Iversen <mail@dahoiv.net>
This commit is contained in:
parent
76bcfd0bfb
commit
4b90e437a0
@ -235,6 +235,13 @@ class device:
|
||||
|
||||
return True
|
||||
|
||||
def get_fwversion(self):
|
||||
packet = bytearray([0x68])
|
||||
response = self.send_packet(0x6a, packet)
|
||||
check_error(response[0x22:0x24])
|
||||
payload = self.decrypt(response[0x38:])
|
||||
return payload[0x4] | payload[0x5] << 8
|
||||
|
||||
def change_name(self, name):
|
||||
packet = bytearray(4)
|
||||
packet.extend(map(ord, name))
|
||||
|
Loading…
Reference in New Issue
Block a user