Skip to content
This repository was archived by the owner on Feb 24, 2021. It is now read-only.

Commit e9553eb

Browse files
committed
fix: prevent ignore discovery to dup values #837
1 parent 9311ff9 commit e9553eb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/Gateway.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -842,17 +842,17 @@ Gateway.prototype.publishDiscovery = function (
842842
update
843843
) {
844844
try {
845+
// set values as discovered
846+
for (let k = 0; k < hassDevice.values.length; k++) {
847+
this.discovered[nodeId + '-' + hassDevice.values[k]] = hassDevice
848+
}
849+
845850
if (hassDevice.ignoreDiscovery) {
846851
return
847852
} else {
848853
hassDevice.ignoreDiscovery = false
849854
}
850855

851-
// set values as discovered
852-
for (let k = 0; k < hassDevice.values.length; k++) {
853-
this.discovered[nodeId + '-' + hassDevice.values[k]] = hassDevice
854-
}
855-
856856
if (this.config.payloadType === 2) {
857857
// Payload is set to "Just Value"
858858
var p = hassDevice.discovery_payload

0 commit comments

Comments
 (0)