mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-26 04:06:34 +00:00
Merge pull request #9410 from DigitalAlchemist/zigbee_time_correction
Fixed last_seen calculation with zigbee devices.
This commit is contained in:
commit
4c0ee053b8
@ -645,7 +645,12 @@ void Z_Devices::setLQI(uint16_t shortaddr, uint8_t lqi) {
|
|||||||
|
|
||||||
void Z_Devices::setLastSeenNow(uint16_t shortaddr) {
|
void Z_Devices::setLastSeenNow(uint16_t shortaddr) {
|
||||||
if (shortaddr == localShortAddr) { return; }
|
if (shortaddr == localShortAddr) { return; }
|
||||||
getShortAddr(shortaddr).last_seen= Rtc.utc_time;
|
// Only update time if after 2020-01-01 0000.
|
||||||
|
// Fixes issue where zigbee device pings before WiFi/NTP has set utc_time
|
||||||
|
// to the correct time, and "last seen" calculations are based on the
|
||||||
|
// pre-corrected last_seen time and the since-corrected utc_time.
|
||||||
|
if (Rtc.utc_time < 1577836800) { return; }
|
||||||
|
getShortAddr(shortaddr).last_seen = Rtc.utc_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user