The SNTP component allows you to configure local timekeeping via Simple Network Time Protocol.
More...
#include <sntp_component.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 SNTP component allows you to configure local timekeeping via Simple Network Time Protocol.
- 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 15 of file sntp_component.h.
◆ dump_config()
void esphome::sntp::SNTPComponent::dump_config |
( |
| ) |
|
|
overridevirtual |
◆ get_setup_priority()
float esphome::sntp::SNTPComponent::get_setup_priority |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ loop()
void esphome::sntp::SNTPComponent::loop |
( |
| ) |
|
|
overridevirtual |
◆ set_servers()
void esphome::sntp::SNTPComponent::set_servers |
( |
const std::string & |
server_1, |
|
|
const std::string & |
server_2, |
|
|
const std::string & |
server_3 |
|
) |
| |
|
inline |
Change the servers used by SNTP for timekeeping.
Definition at line 20 of file sntp_component.h.
◆ setup()
void esphome::sntp::SNTPComponent::setup |
( |
| ) |
|
|
overridevirtual |
◆ update()
void esphome::sntp::SNTPComponent::update |
( |
| ) |
|
|
overridevirtual |
◆ has_time_
bool esphome::sntp::SNTPComponent::has_time_ {false} |
|
protected |
◆ server_1_
std::string esphome::sntp::SNTPComponent::server_1_ |
|
protected |
◆ server_2_
std::string esphome::sntp::SNTPComponent::server_2_ |
|
protected |
◆ server_3_
std::string esphome::sntp::SNTPComponent::server_3_ |
|
protected |
The documentation for this class was generated from the following files: