From 73e939dbbcc9cb12c578e092ec7990e93747322c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 19 Sep 2025 19:09:32 -0500 Subject: [PATCH 1/2] [zephyr] Fix compilation after Path migration (#10811) --- esphome/components/zephyr/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/esphome/components/zephyr/__init__.py b/esphome/components/zephyr/__init__.py index c698122030..ff4644163e 100644 --- a/esphome/components/zephyr/__init__.py +++ b/esphome/components/zephyr/__init__.py @@ -1,4 +1,4 @@ -import os +from pathlib import Path from typing import TypedDict import esphome.codegen as cg @@ -48,7 +48,7 @@ class ZephyrData(TypedDict): bootloader: str prj_conf: dict[str, tuple[PrjConfValueType, bool]] overlay: str - extra_build_files: dict[str, str] + extra_build_files: dict[str, Path] pm_static: list[Section] user: dict[str, list[str]] @@ -93,7 +93,7 @@ def zephyr_add_overlay(content): zephyr_data()[KEY_OVERLAY] += content -def add_extra_build_file(filename: str, path: str) -> bool: +def add_extra_build_file(filename: str, path: Path) -> bool: """Add an extra build file to the project.""" extra_build_files = zephyr_data()[KEY_EXTRA_BUILD_FILES] if filename not in extra_build_files: @@ -102,7 +102,7 @@ def add_extra_build_file(filename: str, path: str) -> bool: return False -def add_extra_script(stage: str, filename: str, path: str): +def add_extra_script(stage: str, filename: str, path: Path) -> None: """Add an extra script to the project.""" key = f"{stage}:{filename}" if add_extra_build_file(filename, path): @@ -144,7 +144,7 @@ def zephyr_to_code(config): add_extra_script( "pre", "pre_build.py", - os.path.join(os.path.dirname(__file__), "pre_build.py.script"), + Path(__file__).parent / "pre_build.py.script", ) From 971522574dd3bc45cd30ce1d699f2de59ef0717f Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 19 Sep 2025 19:10:02 -0500 Subject: [PATCH 2/2] [http_request] Fix Path object passed to C++ codegen (#10812) --- esphome/components/http_request/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/http_request/__init__.py b/esphome/components/http_request/__init__.py index 146458f53b..4884085099 100644 --- a/esphome/components/http_request/__init__.py +++ b/esphome/components/http_request/__init__.py @@ -194,7 +194,7 @@ async def to_code(config): cg.add_define("CPPHTTPLIB_OPENSSL_SUPPORT") elif path := config.get(CONF_CA_CERTIFICATE_PATH): cg.add_define("CPPHTTPLIB_OPENSSL_SUPPORT") - cg.add(var.set_ca_path(path)) + cg.add(var.set_ca_path(str(path))) cg.add_build_flag("-lssl") cg.add_build_flag("-lcrypto")