9#ifdef USE_TIME_TIMEZONE
25#ifdef USE_TIME_TIMEZONE
38 if (
len >=
sizeof(buf))
39 len =
sizeof(buf) - 1;
68#ifdef USE_TIME_TIMEZONE
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.
time_t timestamp_now()
Get the current time as the UTC epoch since January 1st 1970.
void set_timezone(const char *tz)
Set the time zone from a POSIX TZ string.
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 apply_timezone_(const char *tz)
LazyCallbackManager< void()> time_sync_callback_
void set_timezone(const std::string &tz)
Set the time zone from a std::string.
void dump_config() override
void synchronize_epoch_(uint32_t epoch)
Report a unix epoch as current time.
void set_timezone(const char *tz, size_t len)
Set the time zone from a character buffer with known length.
bool check(const Ts &...x) override
TimeHasTimeCondition(RealTimeClock *parent)
bool const ParsedTimezone & tz
A more user-friendly version of struct tm from time.h.
bool is_valid() const
Check if this ESPTime is valid (all fields in range and year is greater than or equal to 2019)
static ESPTime from_epoch_utc(time_t epoch)
Convert an UTC epoch timestamp to a UTC time ESPTime instance.