Base class for all automation conditions.
This class simplifies creating components that periodically check a state.
The RealTimeClock class exposes common timekeeping functions via the device's local real-time clock.
CallbackManager< void()> time_sync_callback_
time_t timestamp_now()
Get the current time as the UTC epoch since January 1st 1970.
void add_on_time_sync_callback(std::function< void()> callback)
ESPTime now()
Get the time in the currently defined timezone.
ESPTime utcnow()
Get the time without any time zone or DST corrections.
void set_timezone(const std::string &tz)
Set the time zone.
std::string get_timezone()
Get the time zone currently in use.
void synchronize_epoch_(uint32_t epoch)
Report a unix epoch as current time.
TimeHasTimeCondition(RealTimeClock *parent)
bool check(Ts... x) override
Providing packet encoding functions for exchanging data with a remote host.
A more user-friendly version of struct tm from time.h.
static ESPTime from_epoch_local(time_t epoch)
Convert an UTC epoch timestamp to a local time ESPTime instance.
bool is_valid() const
Check if this ESPTime is valid (all fields in range and year is greater than 2018)
static ESPTime from_epoch_utc(time_t epoch)
Convert an UTC epoch timestamp to a UTC time ESPTime instance.