[DISC] Fix via device discovery when using secondary module(#2077)
Co-authored-by: Florian <1technophile@users.noreply.github.com>
This commit is contained in:
1 parent
e390aca43b
commit
fcc09df02c
1 file changed
+6
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user