Fix pilight value as subject (#752)

* feat: pilight gateway now send value

* feat: when device id is empty, try fo find it from the message payload
This commit is contained in:
Charles R authored and GitHub committed 2020-09-02 16:46:37 -05:00
1 parent ca3bc436ee
commit 347783a1c4
2 files changed
+23

No files matched your search

+7
View File
@@ -253,10 +253,17 @@ void pub(char* topicori, JsonObject& data) {
if (client.connected()) {
String topic = String(mqtt_topic) + String(topicori);
#ifdef valueAsASubject
# ifdef ZgatewayPilight
String value = data["value"];
if (value != 0) {
topic = topic + "/" + value;
}
# else
SIGNAL_SIZE_UL_ULL value = data["value"];
if (value != 0) {
topic = topic + "/" + String(value);
}
# endif
#endif
#ifdef jsonPublishing