[template][time] Add template time platform (#14838)

Co-authored-by: clydebarrow <2366188+clydebarrow@users.noreply.github.com>
This commit is contained in:
Pat Satyshur
2026-09-27 09:48:08 +00:00
committed by GitHub
co-authored by clydebarrow
parent b8af6cb005
commit ea4754e798
7 changed files with 174 additions and 1 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ class RealTimeClock : public PollingComponent {
ESPTime utcnow() { return ESPTime::from_epoch_utc(this->timestamp_now()); }
/// Get the current time as the UTC epoch since January 1st 1970.
time_t timestamp_now() { return ::time(nullptr); }
virtual time_t timestamp_now() { return ::time(nullptr); }
template<typename F> void add_on_time_sync_callback(F &&callback) {
this->time_sync_callback_.add(std::forward<F>(callback));