Skip to content

Commit

Permalink
[DISC] Fix via device discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
1technophile committed Oct 1, 2024
1 parent e390aca commit 293438f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main/ZgatewaySERIAL.ino
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ void SERIALtoX() {
} else {
// send as json
if (SERIALdata.containsKey("origin") || SERIALdata.containsKey("topic")) {
# ifdef ZmqttDiscovery
// We need to assign the discovery message to the primary module instead of the secondary module
if (SERIALdata.containsKey("device") && SERIALdata["device"].containsKey("via_device")) {
SERIALdata["device"]["via_device"] = gateway_name;
}
# endif
enqueueJsonObject(SERIALdata);
} else {
SERIALdata["origin"] = subjectSERIALtoMQTT;
Expand Down

0 comments on commit 293438f

Please sign in to comment.