From 4705fdf011b7f5ec8b8c30269451bb0a020c6bf2 Mon Sep 17 00:00:00 2001 From: Marcus Stewart Hughes Date: Wed, 9 Nov 2016 22:01:33 +0000 Subject: [PATCH] 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. --- broadlink/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/broadlink/__init__.py b/broadlink/__init__.py index 8e38c06..cd9d159 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