1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-08 00:31:58 +00:00
This commit is contained in:
J. Nick Koston
2026-01-09 11:24:36 -10:00
parent 59bd60b4e2
commit e227fc4f1a
2 changed files with 7 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ from esphome.core import CORE, HexInt
from esphome.types import ConfigType
CODEOWNERS = ["@jesserockz"]
AUTO_LOAD = ["socket"]
AUTO_LOAD = ["network", "socket"]
byte_vector = cg.std_vector.template(cg.uint8)
peer_address_t = cg.std_ns.class_("array").template(cg.uint8, 6)

View File

@@ -1,6 +1,7 @@
import ipaddress
import logging
from esphome import core
import esphome.codegen as cg
from esphome.components.esp32 import add_idf_sdkconfig_option
from esphome.components.psram import is_guaranteed as psram_is_guaranteed
@@ -144,7 +145,11 @@ async def to_code(config):
# Register NetworkComponent to initialize network stack early (ESP32 only)
# This ensures esp_netif_init() is called before web_server binds
if CORE.is_esp32:
var = cg.new_Pvariable(cg.new_id("network_component"))
component_id = core.ID(
"network_component", is_declaration=True, type=NetworkComponent
)
CORE.component_ids.add(component_id.id)
var = cg.new_Pvariable(component_id)
await cg.register_component(var, {})
# Apply high performance networking settings