Correct datastring implementation going to the esp to reset if publishing value and protocol only

This commit is contained in:
1technophile committed 2019-07-26 11:50:54 +02:00
1 parent 4b0d3943ce
commit 60bc75f0b6
1 file changed
+9 -5
+9 -5
View File
@@ -276,20 +276,24 @@ void IRtoMQTT(){
unsigned long data = IRdata["value"];
const char * raw = IRdata["raw"];
const char * datastring = IRdata["datastring"];
if (data != 0||raw||datastring) {
trc(F("MQTTtoIR data || raw ok"));
if (data != 0 || raw || datastring) {
trc(F("MQTTtoIR value || raw || datasring ok"));
bool signalSent = false;
trc(F("value"));
trc(data);
trc(F("raw"));
trc(raw);
if(datastring){
trc(F("datastring"));
trc(datastring);
}else{
datastring ="";
}
const char * protocol_name = IRdata["protocol_name"];
unsigned int valueBITS = IRdata["bits"];
unsigned int valueBITS = IRdata["bits"]|0;
uint16_t valueRPT = IRdata["repeat"]|repeatIRwNumber;
if(raw){
trc(F("raw"));
trc(raw);
unsigned int s = strlen(raw);
//number of "," value count
int count = 0;