Closed christianTF closed 1 year ago
Is there any potential date that issue might be resolved? So basically passing any flat data from topic with values true/false is not possible.
Most data is passed this way. So this is a big big issue for anyone who is using MQTT doesnt it?
Even passing data from simple healthchecks is not possible:
Proposed solution:
Line 458: if there is exception and its exactly: Error on JSON expansion: Inappropriate ioctl for device
we could just simply put everything in topic without any json conversion as such: $sendhash{$topic} = $message;
- it's good eenough I believe and it should work. In the worst case someone's message will be put into the topic without splitting that, it's a lot better than throwing exception and not doing anything really.
I‘m currently on holiday and will address this as soon as I am at home.
https://github.com/mschlenstedt/Loxberry/blob/b4f222e0a6b3535ffbdb6bbc9d2c4b644e10d8ff/sbin/mqttgateway.pl#L428
Problem ist: Das eingehende, blanke
true
wird als valides JSON erkannt (erst seit ca. 1-2 Jahren, als Perl den Parser dem Standard entsprechend erweitert hat) und das Gateway behandelt das Json dann als Objekt- bzw. Property-Liste, und der Flat-Code schlägt damit auf.Es muss deswegen an der Code-Stelle in einem Elseif noch ein if is_enabled || if_disabled hinein (evt. geht auch eine Prüfung auf einen Hash oder dgl.), und nur wenn das nicht zutrifft, darf der flatten-Code starten.