mirror of
https://github.com/esphome/esphome.git
synced 2025-11-15 06:15:47 +00:00
Co-authored-by: J. Nick Koston <nick@home-assistant.io> Co-authored-by: J. Nick Koston <nick+github@koston.org>
23 lines
692 B
C++
23 lines
692 B
C++
#include "homeassistant_time.h"
|
|
#include "esphome/core/log.h"
|
|
|
|
namespace esphome {
|
|
namespace homeassistant {
|
|
|
|
static const char *const TAG = "homeassistant.time";
|
|
|
|
void HomeassistantTime::dump_config() {
|
|
ESP_LOGCONFIG(TAG, "Home Assistant Time");
|
|
RealTimeClock::dump_config();
|
|
}
|
|
|
|
float HomeassistantTime::get_setup_priority() const { return setup_priority::DATA; }
|
|
|
|
void HomeassistantTime::setup() { global_homeassistant_time = this; }
|
|
|
|
void HomeassistantTime::update() { api::global_api_server->request_time(); }
|
|
|
|
HomeassistantTime *global_homeassistant_time = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
|
} // namespace homeassistant
|
|
} // namespace esphome
|