From 2c90f61de117480822d52c52b9c79408290c9646 Mon Sep 17 00:00:00 2001 From: Anton Sergunov Date: Fri, 7 Jun 2024 06:08:43 +0000 Subject: [PATCH] Make it build 7 --- esphome/components/sntp/sntp_component.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/esphome/components/sntp/sntp_component.cpp b/esphome/components/sntp/sntp_component.cpp index ed7407b187..47ffa83749 100644 --- a/esphome/components/sntp/sntp_component.cpp +++ b/esphome/components/sntp/sntp_component.cpp @@ -70,11 +70,12 @@ void SNTPComponent::set_servers(const std::string &server_1, const std::string & const auto &buff = this->servers_[i].empty() ? nullptr : this->servers_[i].c_str(); if (buff != nullptr && buff == sntp_getservername(i)) sntp_setservername(i, nullptr); - max_setup_server = max(max_setup_server, i); } } #endif - this->servers_ = {server_1, server_2, server_3}; + this->servers_[0] = server_1; + this->servers_[1] = server_2; + this->servers_[2] = server_3; #if !defined(USE_HOST) if (this->servers_was_setup_) { this->setup_servers_();