1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-12 06:43:48 +01:00

host platform: improvements and bugfixes (#6137)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Clyde Stubbs
2024-02-07 12:24:06 +11:00
committed by GitHub
parent 0ede4a3095
commit f3ef05f5c3
7 changed files with 36 additions and 7 deletions

View File

@@ -25,6 +25,7 @@ namespace sntp {
static const char *const TAG = "sntp";
void SNTPComponent::setup() {
#ifndef USE_HOST
ESP_LOGCONFIG(TAG, "Setting up SNTP...");
#if defined(USE_ESP32) || defined(USE_LIBRETINY)
if (sntp_enabled()) {
@@ -48,6 +49,7 @@ void SNTPComponent::setup() {
#endif
sntp_init();
#endif
}
void SNTPComponent::dump_config() {
ESP_LOGCONFIG(TAG, "SNTP Time:");
@@ -57,7 +59,7 @@ void SNTPComponent::dump_config() {
ESP_LOGCONFIG(TAG, " Timezone: '%s'", this->timezone_.c_str());
}
void SNTPComponent::update() {
#ifndef USE_ESP_IDF
#if !defined(USE_ESP_IDF) && !defined(USE_HOST)
// force resync
if (sntp_enabled()) {
sntp_stop();