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

[esp32] Add framework migration warning for upcoming ESP-IDF default change

This commit is contained in:
J. Nick Koston
2025-08-02 08:46:08 -10:00
parent 30f988c5f3
commit a1e7317f5e

View File

@@ -684,7 +684,7 @@ class _FrameworkMigrationWarning:
shown = False shown = False
def _show_framework_migration_message(name: str) -> None: def _show_framework_migration_message(name: str, variant: str) -> None:
"""Show a friendly message about framework migration when defaulting to Arduino.""" """Show a friendly message about framework migration when defaulting to Arduino."""
if _FrameworkMigrationWarning.shown: if _FrameworkMigrationWarning.shown:
return return
@@ -698,9 +698,11 @@ def _show_framework_migration_message(name: str) -> None:
f"💡 IMPORTANT: {name} doesn't have a framework specified!", f"💡 IMPORTANT: {name} doesn't have a framework specified!",
) )
+ "\n\n" + "\n\n"
+ "Currently, ESP32 defaults to the Arduino framework.\n" + f"Currently, {variant} defaults to the Arduino framework.\n"
+ color(AnsiFore.YELLOW, "This will change to ESP-IDF in ESPHome 2026.1.0.\n") + color(AnsiFore.YELLOW, "This will change to ESP-IDF in ESPHome 2026.1.0.\n")
+ "\n" + "\n"
+ "Note: Newer ESP32 variants (C6, H2, P4, etc.) already use ESP-IDF by default.\n"
+ "\n"
+ "Why change? ESP-IDF offers:\n" + "Why change? ESP-IDF offers:\n"
+ color(AnsiFore.GREEN, " ✨ Up to 40% smaller binaries\n") + color(AnsiFore.GREEN, " ✨ Up to 40% smaller binaries\n")
+ color(AnsiFore.GREEN, " 🚀 Better performance and optimization\n") + color(AnsiFore.GREEN, " 🚀 Better performance and optimization\n")
@@ -745,7 +747,9 @@ def _set_default_framework(config):
config[CONF_FRAMEWORK] = ARDUINO_FRAMEWORK_SCHEMA({}) config[CONF_FRAMEWORK] = ARDUINO_FRAMEWORK_SCHEMA({})
config[CONF_FRAMEWORK][CONF_TYPE] = FRAMEWORK_ARDUINO config[CONF_FRAMEWORK][CONF_TYPE] = FRAMEWORK_ARDUINO
# Show the migration message # Show the migration message
_show_framework_migration_message(config.get(CONF_NAME, "Your device")) _show_framework_migration_message(
config.get(CONF_NAME, "Your device"), variant
)
else: else:
config[CONF_FRAMEWORK] = ESP_IDF_FRAMEWORK_SCHEMA({}) config[CONF_FRAMEWORK] = ESP_IDF_FRAMEWORK_SCHEMA({})
config[CONF_FRAMEWORK][CONF_TYPE] = FRAMEWORK_ESP_IDF config[CONF_FRAMEWORK][CONF_TYPE] = FRAMEWORK_ESP_IDF