diff options
author | Marcus Stewart Hughes <hello@entirely.pro> | 2016-11-09T22·01+0000 |
---|---|---|
committer | Marcus Hughes <hello@msh100.uk> | 2016-11-10T20·13+0000 |
commit | 4705fdf011b7f5ec8b8c30269451bb0a020c6bf2 (patch) | |
tree | 7794946c8f19788ba7eaf54c9bd32dcbd36415b3 /broadlink | |
parent | 0b9dd40921ae3f3e6b95d19a4a13e5060932831a (diff) |
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.
Diffstat (limited to 'broadlink')
-rwxr-xr-x | broadlink/__init__.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/broadlink/__init__.py b/broadlink/__init__.py index 8e38c06df63f..cd9d1599f144 100755 --- a/broadlink/__init__.py +++ b/broadlink/__init__.py @@ -129,6 +129,7 @@ class device: self.key = payload[0x04:0x14] def send_packet(self, command, payload): + self.count = (self.count + 1) & 0xffff packet = bytearray(0x38) packet[0x00] = 0x5a packet[0x01] = 0xa5 |