diff --git a/script/helpers.py b/script/helpers.py index c9c550d8893..00969efe7c9 100644 --- a/script/helpers.py +++ b/script/helpers.py @@ -167,11 +167,15 @@ def build_all_include(header_files: list[str] | None = None) -> None: cmd = ["git", "ls-files", "esphome/**/*.h"] proc = subprocess.run(cmd, capture_output=True, text=True, check=True) + # X-macro files are included multiple times with different macro definitions + # and must not be included bare + exclude = {"esphome/core/entity_types.h"} + # Process git output - git already returns paths relative to repo root header_files = [ line.replace(os.path.sep, "/") for line in proc.stdout.strip().split("\n") - if line + if line and line.replace(os.path.sep, "/") not in exclude ] headers = [f'#include "{h}"' for h in header_files]