The RealTimeClock class exposes common timekeeping functions via the device's local real-time clock.
More...
#include <real_time_clock.h>
|
void | synchronize_epoch_ (uint32_t epoch) |
| Report a unix epoch as current time. More...
|
|
void | apply_timezone_ () |
|
virtual void | call_loop () |
|
virtual void | call_dump_config () |
|
void | set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f) |
| Set an interval function with a unique name. More...
|
|
void | set_interval (uint32_t interval, std::function< void()> &&f) |
|
bool | cancel_interval (const std::string &name) |
| Cancel an interval function. More...
|
|
void | set_retry (const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f) |
| Set an retry function with a unique name. More...
|
|
void | set_retry (uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f) |
|
bool | cancel_retry (const std::string &name) |
| Cancel a retry function. More...
|
|
void | set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f) |
| Set a timeout function with a unique name. More...
|
|
void | set_timeout (uint32_t timeout, std::function< void()> &&f) |
|
bool | cancel_timeout (const std::string &name) |
| Cancel a timeout function. More...
|
|
void | defer (const std::string &name, std::function< void()> &&f) |
| Defer a callback to the next loop() call. More...
|
|
void | defer (std::function< void()> &&f) |
| Defer a callback to the next loop() call. More...
|
|
bool | cancel_defer (const std::string &name) |
| Cancel a defer callback using the specified name, name must not be empty. More...
|
|
The RealTimeClock class exposes common timekeeping functions via the device's local real-time clock.
- Note
- The C library (newlib) available on ESPs only supports TZ strings that specify an offset and DST info; you cannot specify zone names or paths to zoneinfo files.
- See also
- https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
Definition at line 19 of file real_time_clock.h.
◆ RealTimeClock()
esphome::time::RealTimeClock::RealTimeClock |
( |
| ) |
|
|
explicitdefault |
◆ add_on_time_sync_callback()
void esphome::time::RealTimeClock::add_on_time_sync_callback |
( |
std::function< void()> |
callback | ) |
|
|
inline |
◆ apply_timezone_()
void esphome::time::RealTimeClock::apply_timezone_ |
( |
| ) |
|
|
protected |
◆ call_setup()
void esphome::time::RealTimeClock::call_setup |
( |
| ) |
|
|
overridevirtual |
◆ get_timezone()
std::string esphome::time::RealTimeClock::get_timezone |
( |
| ) |
|
|
inline |
◆ now()
ESPTime esphome::time::RealTimeClock::now |
( |
| ) |
|
|
inline |
Get the time in the currently defined timezone.
Definition at line 30 of file real_time_clock.h.
◆ set_timezone()
void esphome::time::RealTimeClock::set_timezone |
( |
const std::string & |
tz | ) |
|
|
inline |
◆ synchronize_epoch_()
void esphome::time::RealTimeClock::synchronize_epoch_ |
( |
uint32_t |
epoch | ) |
|
|
protected |
◆ timestamp_now()
time_t esphome::time::RealTimeClock::timestamp_now |
( |
| ) |
|
|
inline |
Get the current time as the UTC epoch since January 1st 1970.
Definition at line 36 of file real_time_clock.h.
◆ utcnow()
ESPTime esphome::time::RealTimeClock::utcnow |
( |
| ) |
|
|
inline |
Get the time without any time zone or DST corrections.
Definition at line 33 of file real_time_clock.h.
◆ time_sync_callback_
◆ timezone_
std::string esphome::time::RealTimeClock::timezone_ {} |
|
protected |
The documentation for this class was generated from the following files: