mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-17 02:48:31 -07:00
Attempt to fix lastSeen incorrect leading to incorrect offline state. #3650
This commit is contained in:
parent
a9b54ad668
commit
fda1246fca
@ -95,12 +95,12 @@ class Availability extends Extension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async handleIntervalNotPingable(device) {
|
async handleIntervalNotPingable(device) {
|
||||||
const ago = Date.now() - device.lastSeen;
|
|
||||||
const resolvedEntity = this.zigbee.resolveEntity(device.ieeeAddr);
|
const resolvedEntity = this.zigbee.resolveEntity(device.ieeeAddr);
|
||||||
if (!resolvedEntity || !device.lastSeen) {
|
if (!resolvedEntity || !device.lastSeen) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ago = Date.now() - resolvedEntity.device.lastSeen;
|
||||||
logger.debug(`Non-pingable device '${resolvedEntity.name}' was last seen '${ago / 1000}' seconds ago.`);
|
logger.debug(`Non-pingable device '${resolvedEntity.name}' was last seen '${ago / 1000}' seconds ago.`);
|
||||||
|
|
||||||
if (ago > Hours25) {
|
if (ago > Hours25) {
|
||||||
|
Loading…
Reference in New Issue
Block a user