|
@@ -381,19 +381,39 @@ def publish_device_statusupdate(device, cmd):
|
|
|
def parseRXCode(rx_code, source_cul):
|
|
|
receivedForDevice = None
|
|
|
receivedCmnd = None
|
|
|
+
|
|
|
if rx_code.startswith("i"):
|
|
|
|
|
|
if debug: log_write("INTERTECHNO PROTOCOL")
|
|
|
+ sucessfullyParsedITCode = False
|
|
|
+
|
|
|
+
|
|
|
if rx_code in RXcodesToDevFunction_IT:
|
|
|
receivedForDevice = RXcodesToDevFunction_IT[rx_code][0]
|
|
|
receivedCmnd = RXcodesToDevFunction_IT[rx_code][1]
|
|
|
+ sucessfullyParsedITCode = True
|
|
|
if debug: log_write("DEV: " + receivedForDevice + ", CMD: " + receivedCmnd + ", RX: " + rx_code)
|
|
|
if verbose:
|
|
|
log_write("")
|
|
|
log_write("CUL '" + source_cul + "' received '" + rx_code + "' => DEV: " + receivedForDevice + ", CMD: " + receivedCmnd)
|
|
|
- else:
|
|
|
+
|
|
|
+
|
|
|
+ rx_code = rx_code[0:-2]
|
|
|
+ if not sucessfullyParsedITCode and rx_code in RXcodesToDevFunction_IT:
|
|
|
+ receivedForDevice = RXcodesToDevFunction_IT[rx_code][0]
|
|
|
+ receivedCmnd = RXcodesToDevFunction_IT[rx_code][1]
|
|
|
+ sucessfullyParsedITCode = True
|
|
|
+ if debug: log_write("DEV: " + receivedForDevice + ", CMD: " + receivedCmnd + ", RX: " + rx_code)
|
|
|
+ if verbose:
|
|
|
+ log_write("")
|
|
|
+ log_write("CUL '" + source_cul + "' received '" + rx_code + "' => DEV: " + receivedForDevice + ", CMD: " + receivedCmnd)
|
|
|
+
|
|
|
+
|
|
|
+ if not sucessfullyParsedITCode:
|
|
|
receivedForDevice, receivedCmnd = decodeInterTechnoRX(rx_code)
|
|
|
- if debug: log_write(receivedForDevice + ", " + receivedCmnd)
|
|
|
+ if debug:
|
|
|
+ log_write(str(receivedForDevice) + ", " + str(receivedCmnd))
|
|
|
+
|
|
|
else:
|
|
|
|
|
|
if debug: log_write("OTHER/RAW PROTOCOL")
|
|
@@ -406,9 +426,9 @@ def parseRXCode(rx_code, source_cul):
|
|
|
log_write("CUL '" + source_cul + "' received '" + rx_code + "' => DEV: " + receivedForDevice + ", CMD: " + receivedCmnd)
|
|
|
|
|
|
if debug:
|
|
|
- log_write("DEV: " + receivedForDevice + ", CMD: " + receivedCmnd + ", RX: " + rx_code)
|
|
|
+ log_write("DEV: " + str(receivedForDevice) + ", CMD: " + str(receivedCmnd) + ", RX: " + rx_code)
|
|
|
|
|
|
- if receivedForDevice != None and receivedCmnd != None:
|
|
|
+ if receivedForDevice != None and receivedCmnd != None and receivedForDevice != False and receivedCmnd != False:
|
|
|
publish_device_statusupdate(receivedForDevice, receivedCmnd)
|
|
|
|
|
|
def decodeInterTechnoRX(rx_code):
|