From 28b6eaaebf6253e2a04312b78fea6ee00a25b1d4 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 23 Aug 2026 10:02:57 -0500 Subject: [PATCH] [light] Skip light_json_schema.cpp when json is not used --- esphome/components/light/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/esphome/components/light/__init__.py b/esphome/components/light/__init__.py index 175f5b43cf..8ba5f93985 100644 --- a/esphome/components/light/__init__.py +++ b/esphome/components/light/__init__.py @@ -7,6 +7,7 @@ import esphome.automation as auto import esphome.codegen as cg from esphome.components import mqtt, power_supply, web_server from esphome.components.const import CONF_CHANNEL_COLORS, CONF_IS_WRGB +from esphome.config_helpers import filter_source_files_from_defines import esphome.config_validation as cv from esphome.const import ( CONF_BLUE, @@ -557,3 +558,10 @@ async def new_light(config, *args): @coroutine_with_priority(CoroPriority.CORE) async def to_code(config): cg.add_global(light_ns.using) + + +# light_json_schema.cpp is fully #ifdef'd on USE_JSON; only mqtt and +# web_server use it. +FILTER_SOURCE_FILES = filter_source_files_from_defines( + {"light_json_schema.cpp": "USE_JSON"} +)