ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
template_real_time_clock.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace esphome::template_ {
7
9 public:
10 template<typename F> void set_template(F &&f) { this->f_.set(std::forward<F>(f)); }
11
13 void update() override {}
14
16 time_t timestamp_now() override;
17
18 protected:
20};
21
22} // namespace esphome::template_
Lightweight wrapper for template platform lambdas (stateless function pointers only).
void set(optional< T >(*f)(Args...))
Set the lambda function pointer.
time_t timestamp_now() override
Returns 0 (an invalid time) if the lambda gives no value.
void update() override
The time is computed on demand and never written to the system clock, so there is nothing to poll.
The RealTimeClock class exposes common timekeeping functions via the device's local real-time clock.