1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-30 00:52:20 +01:00

Don't compile unnecessary platform files (e.g. ESP8266 files on ESP32) (#9354)

This commit is contained in:
J. Nick Koston
2025-07-07 16:04:41 -05:00
committed by GitHub
parent b122112d58
commit 440de12e3f
25 changed files with 657 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
from esphome import pins
import esphome.codegen as cg
from esphome.components import esp32, esp32_rmt, remote_base
from esphome.config_helpers import filter_source_files_from_platform
import esphome.config_validation as cv
from esphome.const import (
CONF_BUFFER_SIZE,
@@ -15,6 +16,7 @@ from esphome.const import (
CONF_TYPE,
CONF_USE_DMA,
CONF_VALUE,
PlatformFramework,
)
from esphome.core import CORE, TimePeriod
@@ -170,3 +172,19 @@ async def to_code(config):
cg.add(var.set_buffer_size(config[CONF_BUFFER_SIZE]))
cg.add(var.set_filter_us(config[CONF_FILTER]))
cg.add(var.set_idle_us(config[CONF_IDLE]))
FILTER_SOURCE_FILES = filter_source_files_from_platform(
{
"remote_receiver_esp32.cpp": {
PlatformFramework.ESP32_ARDUINO,
PlatformFramework.ESP32_IDF,
},
"remote_receiver_esp8266.cpp": {PlatformFramework.ESP8266_ARDUINO},
"remote_receiver_libretiny.cpp": {
PlatformFramework.BK72XX_ARDUINO,
PlatformFramework.RTL87XX_ARDUINO,
PlatformFramework.LN882X_ARDUINO,
},
}
)