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:
1 parent
ca3bc436ee
commit
347783a1c4
2 files changed
+23
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user