mirror of
https://github.com/mjg59/python-broadlink.git
synced 2024-11-22 15:10:12 +01:00
each send_packet() needs a unique count
Increment count instead of randomly generating on each send_packet() as per @mjg59's suggestion. Tested and working as expected.
This commit is contained in:
parent
0b9dd40921
commit
4705fdf011
@ -129,6 +129,7 @@ class device:
|
|||||||
self.key = payload[0x04:0x14]
|
self.key = payload[0x04:0x14]
|
||||||
|
|
||||||
def send_packet(self, command, payload):
|
def send_packet(self, command, payload):
|
||||||
|
self.count = (self.count + 1) & 0xffff
|
||||||
packet = bytearray(0x38)
|
packet = bytearray(0x38)
|
||||||
packet[0x00] = 0x5a
|
packet[0x00] = 0x5a
|
||||||
packet[0x01] = 0xa5
|
packet[0x01] = 0xa5
|
||||||
|
Loading…
Reference in New Issue
Block a user