Исправлена обработка команды POWER для совместимости с Tasmota.
authorRoman Bazalevsky <rvb@rvb.name>
Tue, 14 Jan 2020 06:49:08 +0000 (09:49 +0300)
committerRoman Bazalevsky <rvb@rvb.name>
Tue, 14 Jan 2020 06:49:08 +0000 (09:49 +0300)
nmd/nl_mqtt.py

index ab7b997c3e747fb1dafc0929c878c6b932a6d5cd..fc6ddec77d1cbdb910e3b667d03b3a8a02d8e096 100644 (file)
@@ -100,7 +100,7 @@ class MqttDriver(metaclass=Singleton):
                   if command == "power":
                     payload = payload.decode('utf-8').lower()
                     print( "command: POWER " + payload )
                   if command == "power":
                     payload = payload.decode('utf-8').lower()
                     print( "command: POWER " + payload )
-                    if payload == "off":
+                    if payload == "off" or payload == "0":
                       mtrf_command["cmd"] = 0
                     else:  
                       mtrf_command["cmd"] = 2
                       mtrf_command["cmd"] = 0
                     else:  
                       mtrf_command["cmd"] = 2