Skip to content

Commit

Permalink
Avoid duplicated rules creation (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
sikmir authored Mar 5, 2024
1 parent 7dbf43f commit f0f7b26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
wb-zigbee2mqtt (1.3.4) stable; urgency=medium

* Avoid duplicated rules creation

-- Nikolay Korotkiy <nikolay.korotkiy@wirenboard.com> Fri, 01 Mar 2024 16:34:00 +0400

wb-zigbee2mqtt (1.3.3) stable; urgency=medium

* Fix update and state controls parsing (nested json objects)
Expand Down
12 changes: 3 additions & 9 deletions wb-zigbee2mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,14 @@ defineRule('Permit join', {
if (obj.value != '') {
JSON.parse(obj.value, function (k, v) {
if (k == 'friendly_name' && v != 'Coordinator') {
if (getDevice(v) === undefined) {
var device = getDevice(v);
if (device === undefined || !device.isVirtual()) {
defineVirtualDevice(v, {
title: v,
cells: {},
});
} else {
if (!getDevice(v).isVirtual()) {
defineVirtualDevice(v, {
title: v,
cells: {},
});
}
initTracker(v);
}
initTracker(v);
}
});
}
Expand Down

0 comments on commit f0f7b26

Please sign in to comment.