1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-11 14:23:47 +01:00

Merge branch 'integration' into memory_api

This commit is contained in:
J. Nick Koston
2025-10-09 16:04:24 -10:00
19 changed files with 94 additions and 30 deletions

View File

@@ -23,7 +23,7 @@ jobs:
with: with:
debug-only: ${{ github.ref != 'refs/heads/dev' }} # Dry-run when not run on dev branch debug-only: ${{ github.ref != 'refs/heads/dev' }} # Dry-run when not run on dev branch
remove-stale-when-updated: true remove-stale-when-updated: true
operations-per-run: 150 operations-per-run: 400
# The 90 day stale policy for PRs # The 90 day stale policy for PRs
# - PRs # - PRs

View File

@@ -0,0 +1,86 @@
# What does this implement/fix?
Removes redundant ESP32 Arduino test files for the `opentherm` component and cleans up redundant preprocessor conditionals. The ESP-IDF tests provide complete coverage since the opentherm component has no framework-specific implementation differences for ESP32.
Also fixes incorrect preprocessor conditionals - changes `#if defined(ESP32) || defined(USE_ESP_IDF)` to `#ifdef USE_ESP32`. The macro `ESP32` is only defined for the original ESP32 variant, while `USE_ESP32` covers all ESP32 variants (C3, S2, S3, etc.). The `|| defined(USE_ESP_IDF)` was unnecessary since ESP-IDF can only run on ESP32 platforms.
## Background
As part of the ongoing effort to reduce Arduino-specific test redundancy (esphome/backlog#66), this PR removes ESP32 Arduino tests that duplicate IDF test coverage.
**Analysis of opentherm component:**
- Previously used `#if defined(ESP32) || defined(USE_ESP_IDF)` to check for ESP32 **platform**
- This was incorrect: `ESP32` is only defined for the original ESP32 variant, not C3/S2/S3
- Changed to `#ifdef USE_ESP32` which covers all ESP32 variants
- The `|| defined(USE_ESP_IDF)` part was unnecessary since ESP-IDF can only run on ESP32 platforms
- ESP32 timer APIs (`timer_init`, `timer_set_counter_value`, `timer_isr_callback_add`) are ESP-IDF APIs
- These timer APIs work identically in both Arduino and ESP-IDF frameworks since Arduino is now built on ESP-IDF
- Only ESP8266 has framework-specific code (using Arduino's `timer1_*` functions)
- ESP32 implementation is identical across frameworks
## Changes
### Code Cleanup
**OpenTherm component:**
- Fixed incorrect `#if defined(ESP32) || defined(USE_ESP_IDF)` to `#ifdef USE_ESP32` in:
- `esphome/components/opentherm/opentherm.h` (3 locations)
- `esphome/components/opentherm/opentherm.cpp` (4 locations)
- `ESP32` is only defined for the original ESP32 variant, not C3/S2/S3
- `USE_ESP32` correctly covers all ESP32 variants
- The `|| defined(USE_ESP_IDF)` part was unnecessary since ESP-IDF can only be defined on ESP32 platforms
### Test Files Removed
- `tests/components/opentherm/test.esp32-ard.yaml`
- `tests/components/opentherm/test.esp32-c3-ard.yaml`
### Test Coverage Maintained
ESP-IDF test files remain and cover both frameworks:
- `tests/components/opentherm/test.esp32-idf.yaml`
- `tests/components/opentherm/test.esp32-c3-idf.yaml`
### Platform-Specific Tests Retained
Arduino tests remain for ESP8266 (uses Arduino-specific `timer1_*` functions):
- `tests/components/opentherm/test.esp8266-ard.yaml`
## Benefits
- **Reduces CI test time** - 2 fewer redundant test configurations
- **Simplifies code** - Removes redundant preprocessor conditionals
- **Maintains coverage** - IDF tests cover both frameworks for ESP32
## Types of changes
- [x] Code quality improvements to existing code or addition of tests
**Related issue or feature (if applicable):**
- Part of esphome/backlog#66 - Remove redundant ESP32 Arduino tests
**Pull request in [esphome-docs](https://github.com/esphome/esphome-docs) with documentation (if applicable):**
N/A - No user-facing changes
## Test Environment
- [x] ESP32
- [x] ESP32 IDF
- [ ] ESP8266
- [ ] RP2040
- [ ] BK72xx
- [ ] RTL87xx
- [ ] nRF52840
## Example entry for `config.yaml`:
N/A - No configuration changes
## Checklist:
- [x] The code change is tested and works locally.
- [ ] Tests have been added to verify that the new code works (under `tests/` folder).
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated in [esphome-docs](https://github.com/esphome/esphome-docs).

View File

@@ -329,7 +329,8 @@ ARDUINO_FRAMEWORK_VERSION_LOOKUP = {
"dev": cv.Version(3, 3, 1), "dev": cv.Version(3, 3, 1),
} }
ARDUINO_PLATFORM_VERSION_LOOKUP = { ARDUINO_PLATFORM_VERSION_LOOKUP = {
cv.Version(3, 3, 1): cv.Version(55, 3, 31), cv.Version(3, 3, 2): cv.Version(55, 3, 31, "1"),
cv.Version(3, 3, 1): cv.Version(55, 3, 31, "1"),
cv.Version(3, 3, 0): cv.Version(55, 3, 30, "2"), cv.Version(3, 3, 0): cv.Version(55, 3, 30, "2"),
cv.Version(3, 2, 1): cv.Version(54, 3, 21, "2"), cv.Version(3, 2, 1): cv.Version(54, 3, 21, "2"),
cv.Version(3, 2, 0): cv.Version(54, 3, 20), cv.Version(3, 2, 0): cv.Version(54, 3, 20),
@@ -347,8 +348,8 @@ ESP_IDF_FRAMEWORK_VERSION_LOOKUP = {
"dev": cv.Version(5, 5, 1), "dev": cv.Version(5, 5, 1),
} }
ESP_IDF_PLATFORM_VERSION_LOOKUP = { ESP_IDF_PLATFORM_VERSION_LOOKUP = {
cv.Version(5, 5, 1): cv.Version(55, 3, 31), cv.Version(5, 5, 1): cv.Version(55, 3, 31, "1"),
cv.Version(5, 5, 0): cv.Version(55, 3, 31), cv.Version(5, 5, 0): cv.Version(55, 3, 31, "1"),
cv.Version(5, 4, 2): cv.Version(54, 3, 21, "2"), cv.Version(5, 4, 2): cv.Version(54, 3, 21, "2"),
cv.Version(5, 4, 1): cv.Version(54, 3, 21, "2"), cv.Version(5, 4, 1): cv.Version(54, 3, 21, "2"),
cv.Version(5, 4, 0): cv.Version(54, 3, 21, "2"), cv.Version(5, 4, 0): cv.Version(54, 3, 21, "2"),
@@ -363,8 +364,8 @@ ESP_IDF_PLATFORM_VERSION_LOOKUP = {
# - https://github.com/pioarduino/platform-espressif32/releases # - https://github.com/pioarduino/platform-espressif32/releases
PLATFORM_VERSION_LOOKUP = { PLATFORM_VERSION_LOOKUP = {
"recommended": cv.Version(54, 3, 21, "2"), "recommended": cv.Version(54, 3, 21, "2"),
"latest": cv.Version(55, 3, 31), "latest": cv.Version(55, 3, 31, "1"),
"dev": "https://github.com/pioarduino/platform-espressif32.git#develop", "dev": cv.Version(55, 3, 31, "1"),
} }
@@ -656,6 +657,7 @@ def _show_framework_migration_message(name: str, variant: str) -> None:
+ "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")
+ color(AnsiFore.GREEN, " ⚡ 2-3x faster compile times\n")
+ color(AnsiFore.GREEN, " 📦 Custom-built firmware for your exact needs\n") + color(AnsiFore.GREEN, " 📦 Custom-built firmware for your exact needs\n")
+ color( + color(
AnsiFore.GREEN, AnsiFore.GREEN,
@@ -663,7 +665,6 @@ def _show_framework_migration_message(name: str, variant: str) -> None:
) )
+ "\n" + "\n"
+ "Trade-offs:\n" + "Trade-offs:\n"
+ color(AnsiFore.YELLOW, " ⏱️ Compile times are ~25% longer\n")
+ color(AnsiFore.YELLOW, " 🔄 Some components need migration\n") + color(AnsiFore.YELLOW, " 🔄 Some components need migration\n")
+ "\n" + "\n"
+ "What should I do?\n" + "What should I do?\n"

View File

@@ -1,4 +0,0 @@
<<: !include common.yaml
esp32:
cpu_frequency: 80MHz

View File

@@ -1 +0,0 @@
<<: !include common.yaml

View File

@@ -1 +0,0 @@
<<: !include common.yaml

View File

@@ -1 +0,0 @@
<<: !include common-usb_cdc.yaml

View File

@@ -1 +0,0 @@
<<: !include common-default_uart.yaml

View File

@@ -1 +0,0 @@
<<: !include common-default_uart.yaml

View File

@@ -1 +0,0 @@
<<: !include common-enabled.yaml

View File

@@ -1 +0,0 @@
<<: !include common-enabled.yaml

View File

@@ -1,4 +0,0 @@
substitutions:
network_enable_ipv6: "true"
<<: !include common.yaml

View File

@@ -1,4 +0,0 @@
substitutions:
network_enable_ipv6: "true"
<<: !include common.yaml

View File

@@ -1 +0,0 @@
<<: !include common.yaml

View File

@@ -1 +0,0 @@
<<: !include common.yaml

View File

@@ -1 +0,0 @@
<<: !include common.yaml

View File

@@ -1 +0,0 @@
<<: !include common.yaml