From 665078f5f55cc51ea672c950dfecbe0048d96a65 Mon Sep 17 00:00:00 2001 From: Florian <1technophile@users.noreply.github.com> Date: Fri, 14 Jan 2022 17:46:19 -0600 Subject: [PATCH] Fix ir protocol name not correctly displayed on esp8266 (#1129) --- main/ZgatewayIR.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/ZgatewayIR.ino b/main/ZgatewayIR.ino index a5f9432b43..b78311a92b 100644 --- a/main/ZgatewayIR.ino +++ b/main/ZgatewayIR.ino @@ -128,7 +128,8 @@ void IRtoMQTT() { # if defined(ESP8266) || defined(ESP32) //resultToHexidecimal is only available with IRremoteESP8266 String hex = resultToHexidecimal(&results); IRdata["hex"] = (const char*)hex.c_str(); - IRdata["protocol_name"] = (const char*)(typeToString(results.decode_type, false)).c_str(); + String protocol = typeToString(results.decode_type, false); + IRdata["protocol_name"] = (const char*)protocol.c_str(); # endif String rawCode = ""; // Dump data @@ -143,7 +144,6 @@ void IRtoMQTT() { if (i < results.rawlen - 1) rawCode = rawCode + ","; // ',' not needed on last one } - //trc(rawCode); IRdata["raw"] = rawCode; // if needed we directly resend the raw code # ifdef RawDirectForward