From 6e8ef553818e41d3c70a7cc0bd5cb617798bb369 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 15 Mar 2026 17:03:21 -1000 Subject: [PATCH] [ethernet] Fix AttributeError: CORE has no using_platformio Only exclude esp_eth_phy_jl1101.c at the Python level on IDF >= 6.0. On IDF 5.4.2+ with PlatformIO, the file's own preprocessor guard (checking the C-level PLATFORMIO define) compiles it to empty. --- esphome/components/ethernet/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/esphome/components/ethernet/__init__.py b/esphome/components/ethernet/__init__.py index 20e79279ff7..3cc39c6e9ea 100644 --- a/esphome/components/ethernet/__init__.py +++ b/esphome/components/ethernet/__init__.py @@ -621,10 +621,9 @@ def _filter_source_files() -> list[str]: from esphome.components.esp32 import idf_version # Custom JL1101 driver not needed on IDF >= 6.0 (uses generic PHY) - # or IDF >= 5.4.2 with PlatformIO (uses builtin driver) - if idf_version() >= cv.Version(6, 0, 0) or ( - idf_version() >= cv.Version(5, 4, 2) and CORE.using_platformio - ): + # On IDF 5.4.2+ with PlatformIO, the .c file compiles to empty via + # its own preprocessor guard (PLATFORMIO is a C-level define) + if idf_version() >= cv.Version(6, 0, 0): excluded.append("esp_eth_phy_jl1101.c") return excluded