From 77a7cd5d6e1aca4f2b8903f19f65cba2e16e19b0 Mon Sep 17 00:00:00 2001 From: 1technophile Date: Wed, 15 Mar 2017 20:09:41 +0100 Subject: [PATCH] correct issue when using a special pulselength or/and a special protocol and the default subject in this case special protocol and pulselength are not taken into account https://community.home-assistant.io/t/433mhz-infrared-ir-to-and-from-mqtt-on-esp8266/6779/89?u=1technophile correct issue when using a special pulselength or/and a special protocol correct issue when using a special pulselength or/and a special protocol and the default subject in this case special protocol and pulselength are not taken into account https://community.home-assistant.io/t/433mhz-infrared-ir-to-and-from-mqtt-on-esp8266/6779/89?u=1technophile --- OpenMQTTGateway.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenMQTTGateway.ino b/OpenMQTTGateway.ino index dba1c1c..2ed3ad8 100644 --- a/OpenMQTTGateway.ino +++ b/OpenMQTTGateway.ino @@ -311,8 +311,10 @@ void receivingMQTT(char * topicOri, char * datacallback) { mySwitch.send(data, 24); } else if ((valuePRT != 0) || (valuePLSL != 0)){ trc(F("Sending data by RF, user defined parameters")); - if (valuePLSL != 0) valuePRT = 1; - if (valuePRT != 0) valuePLSL = 350; + if (valuePRT == 0) valuePRT = 1; + if (valuePLSL == 0) valuePLSL = 350; + trc(String(valuePRT)); + trc(String(valuePLSL)); mySwitch.setProtocol(valuePRT,valuePLSL); mySwitch.send(data, 24); }