From 2b8e7f0f4e5d37762ed4a753405d2269190fb7ec Mon Sep 17 00:00:00 2001 From: Florian <1technophile@users.noreply.github.com> Date: Tue, 7 Nov 2023 08:17:35 -0600 Subject: [PATCH] Update ZgatewayIR.ino --- main/ZgatewayIR.ino | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main/ZgatewayIR.ino b/main/ZgatewayIR.ino index 887b06658d..682fbf9863 100644 --- a/main/ZgatewayIR.ino +++ b/main/ZgatewayIR.ino @@ -274,8 +274,12 @@ void MQTTtoIR(char* topicOri, JsonObject& IRdata) { } if (signalSent) { // we acknowledge the sending by publishing the value to an acknowledgement topic, for the moment even if it is a signal repetition we acknowledge also Log.notice(F("MQTTtoIR OK" CR)); - IRdata["origin"] = subjectGTWIRtoMQTT; - enqueueJsonObject(IRdata); + // copy IRdata to IRdataAck document + StaticJsonDocument IRdataAckBuffer; + JsonObject IRdataAck = IRdataAckBuffer.to(); + IRdataAck = IRdata; + IRdataAck["origin"] = subjectGTWIRtoMQTT; + enqueueJsonObject(IRdataAck); } irrecv.enableIRIn(); // ReStart the IR receiver (if not restarted it is not able to receive data) } else {