Compare commits

..
2 changed files with 15 additions and 10 deletions
-8
View File
@@ -7,7 +7,6 @@ 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,
@@ -558,10 +557,3 @@ 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 only used by mqtt and web_server, which both
# auto load json; USE_JSON alone is too broad since other components load it.
FILTER_SOURCE_FILES = filter_source_files_from_defines(
{"light_json_schema.cpp": ("USE_MQTT", "USE_WEBSERVER")}
)
+15 -2
View File
@@ -5,7 +5,10 @@ import re
from esphome import automation, pins
import esphome.codegen as cg
from esphome.components.const import CONF_DATA_BITS, CONF_PARITY, CONF_STOP_BITS
from esphome.config_helpers import filter_source_files_from_platform
from esphome.config_helpers import (
filter_source_files_from_defines,
filter_source_files_from_platform,
)
import esphome.config_validation as cv
from esphome.const import (
CONF_AFTER,
@@ -521,7 +524,7 @@ async def final_step():
cg.add_define("USE_UART_WAKE_LOOP_ON_RX")
FILTER_SOURCE_FILES = filter_source_files_from_platform(
_platform_filter = filter_source_files_from_platform(
{
"uart_component_esp_idf.cpp": {
PlatformFramework.ESP32_IDF,
@@ -537,3 +540,13 @@ FILTER_SOURCE_FILES = filter_source_files_from_platform(
},
}
)
# uart_debugger.cpp is fully #ifdef'd on USE_UART_DEBUGGER, set only when a
# debug block is configured.
_define_filter = filter_source_files_from_defines(
{"uart_debugger.cpp": "USE_UART_DEBUGGER"}
)
def FILTER_SOURCE_FILES() -> list[str]:
return _platform_filter() + _define_filter()