mirror of
https://github.com/esphome/esphome.git
synced 2025-10-18 17:53:47 +01:00
Don't compile unnecessary platform files (e.g. ESP8266 files on ESP32) (#9354)
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import esphome.codegen as cg
|
||||
from esphome.components import uart
|
||||
from esphome.config_helpers import filter_source_files_from_platform
|
||||
from esphome.const import PlatformFramework
|
||||
|
||||
nextion_ns = cg.esphome_ns.namespace("nextion")
|
||||
Nextion = nextion_ns.class_("Nextion", cg.PollingComponent, uart.UARTDevice)
|
||||
@@ -8,3 +10,17 @@ nextion_ref = Nextion.operator("ref")
|
||||
CONF_NEXTION_ID = "nextion_id"
|
||||
CONF_PUBLISH_STATE = "publish_state"
|
||||
CONF_SEND_TO_NEXTION = "send_to_nextion"
|
||||
|
||||
FILTER_SOURCE_FILES = filter_source_files_from_platform(
|
||||
{
|
||||
"nextion_upload_arduino.cpp": {
|
||||
PlatformFramework.ESP32_ARDUINO,
|
||||
PlatformFramework.ESP8266_ARDUINO,
|
||||
PlatformFramework.RP2040_ARDUINO,
|
||||
PlatformFramework.BK72XX_ARDUINO,
|
||||
PlatformFramework.RTL87XX_ARDUINO,
|
||||
PlatformFramework.LN882X_ARDUINO,
|
||||
},
|
||||
"nextion_upload_idf.cpp": {PlatformFramework.ESP32_IDF},
|
||||
}
|
||||
)
|
||||
|
Reference in New Issue
Block a user