Enable networking and some other components on host platform (#6114)

This commit is contained in:
Clyde Stubbs
2024-01-19 12:10:23 +11:00
committed by GitHub
parent 6a6a70f1e5
commit 8267b3274c
6 changed files with 29 additions and 3 deletions
+5 -1
View File
@@ -6,6 +6,7 @@ from esphome.const import (
PLATFORM_HOST,
)
from esphome.core import CORE
from esphome.helpers import IS_MACOS
import esphome.config_validation as cv
import esphome.codegen as cg
@@ -14,7 +15,6 @@ from .const import KEY_HOST
# force import gpio to register pin schema
from .gpio import host_pin_to_code # noqa
CODEOWNERS = ["@esphome/core"]
AUTO_LOAD = ["network"]
@@ -35,5 +35,9 @@ CONFIG_SCHEMA = cv.All(
async def to_code(config):
cg.add_build_flag("-DUSE_HOST")
cg.add_build_flag("-std=c++17")
cg.add_build_flag("-lsodium")
if IS_MACOS:
cg.add_build_flag("-L/opt/homebrew/lib")
cg.add_define("ESPHOME_BOARD", "host")
cg.add_platformio_option("platform", "platformio/native")