Skip to content

Commit

Permalink
Fix device availability. #1395
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Apr 16, 2019
1 parent 3a5bdff commit 2f187ae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/extension/deviceAvailability.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ class DeviceAvailability {
}, mechanism);
}

setTimer(ieeeAddr) {
if (this.timers[ieeeAddr]) {
clearTimeout(this.timers[ieeeAddr]);
setTimer(device) {
if (this.timers[device.ieeeAddr]) {
clearTimeout(this.timers[device.ieeeAddr]);
}

this.timers[ieeeAddr] = setTimeout(() => {
this.handleInterval(ieeeAddr);
this.timers[device.ieeeAddr] = setTimeout(() => {
this.handleInterval(device);
}, utils.secondsToMilliseconds(this.availability_timeout));
}

Expand Down

0 comments on commit 2f187ae

Please sign in to comment.