about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xbroadlink/__init__.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/broadlink/__init__.py b/broadlink/__init__.py
index c981d6b3eaa4..2891052708a3 100755
--- a/broadlink/__init__.py
+++ b/broadlink/__init__.py
@@ -25,14 +25,21 @@ class rm2:
     self.cs.bind(('',0)) 
     self.port = self.cs.getsockname()[1]
 
+    timezone = time.timezone/-3600
     packet = bytearray(0x30)
 
     year = datetime.now().year
 
-    packet[0x08] = 0xf9
-    packet[0x09] = 0xff
-    packet[0x0a] = 0xff
-    packet[0x0b] = 0xff
+    if timezone < 0:
+      packet[0x08] = 0xff + timezone - 1
+      packet[0x09] = 0xff
+      packet[0x0a] = 0xff
+      packet[0x0b] = 0xff
+    else:
+      packet[0x08] = timezone
+      packet[0x09] = 0
+      packet[0x0a] = 0
+      packet[0x0b] = 0
     packet[0x0c] = year & 0xff
     packet[0x0d] = year >> 8
     packet[0x0e] = datetime.now().minute