mirror of
https://github.com/esphome/esphome.git
synced 2025-11-16 06:45:48 +00:00
[sntp] Resolve warnings from ESP-IDF 5.x (#7913)
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import esphome.codegen as cg
|
||||
from esphome.components import time as time_
|
||||
import esphome.config_validation as cv
|
||||
import esphome.codegen as cg
|
||||
from esphome.core import CORE
|
||||
from esphome.const import (
|
||||
CONF_ID,
|
||||
CONF_SERVERS,
|
||||
PLATFORM_BK72XX,
|
||||
PLATFORM_ESP32,
|
||||
PLATFORM_ESP8266,
|
||||
PLATFORM_RP2040,
|
||||
PLATFORM_RTL87XX,
|
||||
PLATFORM_BK72XX,
|
||||
)
|
||||
from esphome.core import CORE
|
||||
|
||||
DEPENDENCIES = ["network"]
|
||||
sntp_ns = cg.esphome_ns.namespace("sntp")
|
||||
@@ -40,11 +40,8 @@ CONFIG_SCHEMA = cv.All(
|
||||
|
||||
|
||||
async def to_code(config):
|
||||
var = cg.new_Pvariable(config[CONF_ID])
|
||||
|
||||
servers = config[CONF_SERVERS]
|
||||
servers += [""] * (3 - len(servers))
|
||||
cg.add(var.set_servers(*servers))
|
||||
var = cg.new_Pvariable(config[CONF_ID], servers)
|
||||
|
||||
await cg.register_component(var, config)
|
||||
await time_.register_time(var, config)
|
||||
|
||||
Reference in New Issue
Block a user