From 811692fed88bf4bfa6d0d39f804fd56b77753694 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 9 Apr 2019 19:17:16 +0200 Subject: [PATCH] Fix device availability. https://github.com/Koenkk/zigbee2mqtt/issues/1395 --- lib/extension/deviceAvailability.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/extension/deviceAvailability.js b/lib/extension/deviceAvailability.js index 5816de5c..591eecf8 100644 --- a/lib/extension/deviceAvailability.js +++ b/lib/extension/deviceAvailability.js @@ -90,13 +90,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)); }