From 159376b81914920ccfd202c8f45de60608747386 Mon Sep 17 00:00:00 2001 From: Florian <1technophile@users.noreply.github.com> Date: Tue, 30 Apr 2019 20:50:16 +0200 Subject: [PATCH] correct PilighttoMQTT json format #387 --- ZgatewayPilight.ino | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ZgatewayPilight.ino b/ZgatewayPilight.ino index fedbb73..13ce714 100644 --- a/ZgatewayPilight.ino +++ b/ZgatewayPilight.ino @@ -46,14 +46,15 @@ void PilighttoMQTT(){ rf.loop(); } -void pilightCallback(const String &protocol, const String &message, int status, +void pilightCallback(const String &protocol,const String &message, int status, size_t repeats, const String &deviceID) { if (status == VALID) { trc(F("Creating RF PiLight buffer")); StaticJsonBuffer jsonBuffer; JsonObject& RFPiLightdata = jsonBuffer.createObject(); - trc(F("Rcv. Pilight")); - RFPiLightdata.set("message", (char *)message.c_str()); + StaticJsonBuffer jsonBuffer2; + JsonObject& msg = jsonBuffer2.parseObject(message); + RFPiLightdata.set("message", msg); RFPiLightdata.set("protocol",(char *)protocol.c_str()); RFPiLightdata.set("length", (char *)deviceID.c_str()); RFPiLightdata.set("repeats", (int)repeats);