Browse Source

2023-05-29:
- fix #1 - TypeError: cannot unpack non-iterable NoneType object
add try/except to catch this rarely occuring error
cul2mqtt.py[1850863]: parseRXCode(inCmd, source_cul)# May 03 14:41:11 pve cul2mqtt.py[1850863]: File "/home/pi/cul2mqtt/cul2mqtt.py", line 434, in parseRXCode
cul2mqtt.py[1850863]: receivedForDevice, receivedCmnd = decodeInterTechnoRX(rx_code_stripped)
cul2mqtt.py[1850863]: TypeError: cannot unpack non-iterable NoneType object

FloKra 11 months ago
parent
commit
08b950e913
2 changed files with 12 additions and 2 deletions
  1. 7 0
      CHANGELOG.txt
  2. 5 2
      cul2mqtt.py

+ 7 - 0
CHANGELOG.txt

@@ -1,3 +1,10 @@
+2023-05-29: 
+  - fix #1 - TypeError: cannot unpack non-iterable NoneType object
+        add try/except to catch this rarely occuring error
+        cul2mqtt.py[1850863]: parseRXCode(inCmd, source_cul)# May 03 14:41:11 pve cul2mqtt.py[1850863]: File "/home/pi/cul2mqtt/cul2mqtt.py", line 434, in parseRXCode
+        cul2mqtt.py[1850863]: receivedForDevice, receivedCmnd = decodeInterTechnoRX(rx_code_stripped)
+        cul2mqtt.py[1850863]: TypeError: cannot unpack non-iterable NoneType object
+	
 2023-03-14:
   - fixed bug in MQTT on_message callback if add_statTopics_on is defined for device
   

+ 5 - 2
cul2mqtt.py

@@ -430,8 +430,11 @@ def parseRXCode(rx_code, source_cul):
         
         # if this also did not work, try to parse it as "default/cheap" Intertechno code... 
         if not sucessfullyParsedITCode:
-            if debug: log_write("    code parsed as 'default/cheap' Intertechno code")
-            receivedForDevice, receivedCmnd = decodeInterTechnoRX(rx_code_stripped)
+            if debug: log_write("    treat code as 'default/cheap' Intertechno code...")
+            try:
+                receivedForDevice, receivedCmnd = decodeInterTechnoRX(rx_code_stripped)
+            except:
+                log_write("    Error parsing code as 'default/cheap' Intertechno code.")
             if debug: 
                 log_write(str(receivedForDevice) + ", " + str(receivedCmnd))