[IR] Fix hex and protocol_name (#1826)
Fix hex and protocol name field value persistence during the json object lifecycle
This commit is contained in:
1 parent
4c633da151
commit
f4a03c39e0
1 file changed
+2
-4
+2
-4
@@ -126,10 +126,8 @@ void IRtoMQTT() {
|
|||||||
IRdata["protocol"] = (int)(results.decode_type);
|
IRdata["protocol"] = (int)(results.decode_type);
|
||||||
IRdata["bits"] = (int)(results.bits);
|
IRdata["bits"] = (int)(results.bits);
|
||||||
# if defined(ESP8266) || defined(ESP32) //resultToHexidecimal is only available with IRremoteESP8266
|
# if defined(ESP8266) || defined(ESP32) //resultToHexidecimal is only available with IRremoteESP8266
|
||||||
String hex = resultToHexidecimal(&results);
|
IRdata["hex"] = resultToHexidecimal(&results);
|
||||||
IRdata["hex"] = (const char*)hex.c_str();
|
IRdata["protocol_name"] = typeToString(results.decode_type, false);
|
||||||
String protocol = typeToString(results.decode_type, false);
|
|
||||||
IRdata["protocol_name"] = (const char*)protocol.c_str();
|
|
||||||
# endif
|
# endif
|
||||||
String rawCode = "";
|
String rawCode = "";
|
||||||
// Dump data
|
// Dump data
|
||||||
|
|||||||
Reference in new issue
Block a user