mirror of https://github.com/arendst/Tasmota.git
Merge pull request #9774 from s-hadinger/start_valid_time
Use START_VALID_TIME
This commit is contained in:
commit
327ca0aa85
|
@ -315,7 +315,7 @@ void Z_Device::setLastSeenNow(void) {
|
|||
// 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; }
|
||||
if (Rtc.utc_time < START_VALID_TIME) { return; }
|
||||
last_seen = Rtc.utc_time;
|
||||
}
|
||||
|
||||
|
|
|
@ -1949,19 +1949,19 @@ void ZCLFrame::autoResponder(const uint16_t *attr_list_ids, size_t attr_len) {
|
|||
break;
|
||||
#endif
|
||||
case 0x000A0000: // Time
|
||||
attr.setUInt((Rtc.utc_time > (60 * 60 * 24 * 365 * 10)) ? Rtc.utc_time - 946684800 : Rtc.utc_time);
|
||||
attr.setUInt((Rtc.utc_time > START_VALID_TIME) ? Rtc.utc_time - 946684800 : Rtc.utc_time);
|
||||
break;
|
||||
case 0x000AFF00: // TimeEpoch - Tasmota specific
|
||||
attr.setUInt(Rtc.utc_time);
|
||||
break;
|
||||
case 0x000A0001: // TimeStatus
|
||||
attr.setUInt((Rtc.utc_time > (60 * 60 * 24 * 365 * 10)) ? 0x02 : 0x00); // if time is beyond 2010 then we are synchronized
|
||||
attr.setUInt((Rtc.utc_time > START_VALID_TIME) ? 0x02 : 0x00);
|
||||
break;
|
||||
case 0x000A0002: // TimeZone
|
||||
attr.setUInt(Settings.toffset[0] * 60);
|
||||
break;
|
||||
case 0x000A0007: // LocalTime // TODO take DST
|
||||
attr.setUInt(Settings.toffset[0] * 60 + ((Rtc.utc_time > (60 * 60 * 24 * 365 * 10)) ? Rtc.utc_time - 946684800 : Rtc.utc_time));
|
||||
attr.setUInt(Settings.toffset[0] * 60 + ((Rtc.utc_time > START_VALID_TIME) ? Rtc.utc_time - 946684800 : Rtc.utc_time));
|
||||
break;
|
||||
}
|
||||
if (!attr.isNone()) {
|
||||
|
|
Loading…
Reference in New Issue