1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-08 00:31:58 +00:00

[time] Always call time sync callbacks even when time unchanged (#13456)

This commit is contained in:
J. Nick Koston
2026-01-22 11:27:04 -10:00
committed by Jonathan Swoboda
parent fb984cd052
commit ec791063b3

View File

@@ -40,6 +40,9 @@ void RealTimeClock::synchronize_epoch_(uint32_t epoch) {
// Unsigned subtraction handles wraparound correctly, then cast to signed
int32_t diff = static_cast<int32_t>(epoch - static_cast<uint32_t>(current_time));
if (diff >= -1 && diff <= 1) {
// Time is already synchronized, but still call callbacks so components
// waiting for time sync (e.g., uptime timestamp sensor) can initialize
this->time_sync_callback_.call();
return;
}
}