This commit is contained in:
Koen Kanters
2020-07-27 23:04:59 +02:00
parent ef6572dfd0
commit 44b26f9b22
+5 -1
View File
@@ -102,7 +102,11 @@ class EntityPublish extends Extension {
// Convert the MQTT message to a Zigbee message.
let json = {};
if (topic.hasOwnProperty('attribute') && topic.attribute) {
json[topic.attribute] = message;
try {
json[topic.attribute] = JSON.parse(message);
} catch (e) {
json[topic.attribute] = message;
}
} else {
try {
json = JSON.parse(message);