From daaffdb6ca34ccbbbb23294bd5d0d315db5e8773 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Mon, 14 Jul 2025 13:51:21 +0200 Subject: [PATCH 01/51] Set ESP-IDF as default framework --- ...Ultimate-Easy-ESPHome_addon_ble_proxy.yaml | 25 ------------------- .../TX-Ultimate-Easy-ESPHome_core_common.yaml | 2 ++ ...TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml | 11 +++++--- 3 files changed, 10 insertions(+), 28 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml index 0e6dbb3..1346efb 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml @@ -11,35 +11,13 @@ ##### - For normal system use, modifications to this file are NOT required. ##### #################################################################################################### --- -packages: - standard_hw_speaker: !include TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml - bluetooth_proxy: -esp32: - framework: - type: esp-idf - esphome: platformio_options: build_flags: - -D TX_ULTIMATE_EASY_ADDON_BLE_PROXY -i2s_audio: !remove - -light: - - id: !extend light_full - platform: esp32_rmt_led_strip - rgb_order: GRB - # rmt_channel: 1 # Not supported with IDF 5 - chipset: ws2812 - max_refresh_rate: 33ms - use_psram: false - type: !remove - variant: !remove - -media_player: !remove - script: - id: !extend dump_config_list_packages then: @@ -52,7 +30,4 @@ script: // Identify itself ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Add-on - BLE Proxy"); - -switch: - - id: !remove sw_speaker_amplifier ... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_common.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_common.yaml index dfd7cbf..85c9313 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_common.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_common.yaml @@ -63,6 +63,8 @@ button: esp32: board: esp32dev flash_size: 8MB + framework: + type: esp-idf esphome: name: ${name} diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml index 48c8f34..e23d649 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml @@ -50,9 +50,14 @@ light: num_leds: 32 pin: GPIO13 restore_mode: ${LIGHT_FULL_RESTORE_MODE} - platform: neopixelbus - type: GRB - variant: WS2811 + platform: esp32_rmt_led_strip + rgb_order: GRB + chipset: ws2812 + max_refresh_rate: 33ms + use_psram: false + # platform: neopixelbus + # type: GRB + # variant: WS2811 # Those lights are available based on the model selections - &light_partition_with_effects From 0a3ceb97f57c0e2eab1b1915d41c94acdd3962a7 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Mon, 14 Jul 2025 13:54:07 +0200 Subject: [PATCH 02/51] No special settings for IDF --- .test/common_idf.yaml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.test/common_idf.yaml b/.test/common_idf.yaml index 9351dd6..b163814 100644 --- a/.test/common_idf.yaml +++ b/.test/common_idf.yaml @@ -5,14 +5,4 @@ packages: esp32: framework: type: esp-idf - -light: - - id: !extend light_full - platform: esp32_rmt_led_strip - rgb_order: GRB - chipset: ws2812 - max_refresh_rate: 33ms - use_psram: false - type: !remove - variant: !remove ... From 680042a428d4f4e455be7ec6c92e6ae1786f94ae Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 08:44:46 +0200 Subject: [PATCH 03/51] Replaces `i2s_audio.media_player` by `i2s_audio.speaker.media_player` --- ...te-Easy-ESPHome_standard_media_player.yaml | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml index 32a8eb5..e249865 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml @@ -23,16 +23,11 @@ media_player: - id: mp_media_player name: Media Player internal: false - platform: i2s_audio - i2s_dout_pin: GPIO15 - i2s_audio_id: if_i2s_audio - i2s_comm_fmt: msb - dac_type: external - mode: mono - mute_pin: - number: GPIO26 - inverted: true - allow_other_uses: true + platform: speaker + announcement_pipeline: + speaker: announcement_spk_resampling_input + media_pipeline: + speaker: media_spk_resampling_input script: - id: !extend dump_config_list_packages @@ -50,6 +45,20 @@ script: // Identify itself ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Add-on - Media Player"); +speaker: + - platform: mixer + id: mixer_speaker_embedded + output_speaker: speaker_embedded + source_speakers: + - id: announcement_speaker_embedded + - id: media_speaker_embedded + - platform: resampler + id: announcement_spk_resampling_input + output_speaker: announcement_speaker_embedded + - platform: resampler + id: media_spk_resampling_input + output_speaker: media_speaker_embedded + switch: - id: sw_speaker_amplifier name: Speaker - Amplifier From 1bd51f304d02bff43192244f494371e601433af9 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 09:00:38 +0200 Subject: [PATCH 04/51] Deprecate BLE proxy addon package This kind of solves #9 Replace TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml with compilation error to force migration to direct bluetooth_proxy configuration. BREAKING CHANGE: Configurations including this package will fail to compile. Users must remove the package reference and add bluetooth_proxy directly to their YAML. Before: packages: addon_bluetooth_proxy: !include TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml After: bluetooth_proxy: --- ...Ultimate-Easy-ESPHome_addon_ble_proxy.yaml | 30 +++++++------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml index 1346efb..f04c587 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml @@ -2,32 +2,22 @@ ##### TX Ultimate Easy for ESPHome ##### ##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy ##### #################################################################################################### -##### Purpose: ESPHome Core - Add-on - BLE Proxy ##### +##### Purpose: ESPHome Core - Add-on - BLE Proxy (REMOVED) ##### #################################################################################################### ##### Author: edwardtfn - https://github.com/edwardtfn - https://buymeacoffee.com/edwardfirmo ##### #################################################################################################### -##### NOTE: ##### -##### - Make changes ONLY if absolutely necessary and you have the required knowledge. ##### -##### - For normal system use, modifications to this file are NOT required. ##### +##### REMOVAL NOTICE: ##### +##### This package has been removed. Please update your configuration. ##### +##### Add BLE proxy functionality directly in your YAML configuration instead: ##### +##### bluetooth_proxy: ##### #################################################################################################### --- -bluetooth_proxy: - -esphome: - platformio_options: - build_flags: - - -D TX_ULTIMATE_EASY_ADDON_BLE_PROXY - +# Trigger the error at compile time script: - - id: !extend dump_config_list_packages + - id: force_compilation_error then: - - script.wait: dump_config - lambda: |- - // Check for requirements - #if !defined(TX_ULTIMATE_EASY_CORE) - #error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required." - #endif - - // Identify itself - ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Add-on - BLE Proxy"); + #error "The package TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml has been removed." \ + "Please remove this package from your configuration and add" \ + "'bluetooth_proxy:' directly to your YAML instead." ... From 36b28a2475816cc795b1667df38d8e87c935cb9e Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 09:03:45 +0200 Subject: [PATCH 05/51] Make media player dependent on speaker --- .test/esphome_ard_ble_proxy.yaml | 3 ++- .test/esphome_idf_ble_proxy.yaml | 2 ++ ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.test/esphome_ard_ble_proxy.yaml b/.test/esphome_ard_ble_proxy.yaml index 097e273..a6eebcc 100644 --- a/.test/esphome_ard_ble_proxy.yaml +++ b/.test/esphome_ard_ble_proxy.yaml @@ -3,5 +3,6 @@ packages: common_arduino: !include common_ard.yaml core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml standard_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml - addon_bluetooth_proxy: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml + +bluetooth_proxy: ... diff --git a/.test/esphome_idf_ble_proxy.yaml b/.test/esphome_idf_ble_proxy.yaml index dc303a6..58eeda2 100644 --- a/.test/esphome_idf_ble_proxy.yaml +++ b/.test/esphome_idf_ble_proxy.yaml @@ -4,4 +4,6 @@ packages: core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml standard_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml addon_bluetooth_proxy: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml + +bluetooth_proxy: ... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml index e249865..bebc6cf 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml @@ -12,7 +12,7 @@ #################################################################################################### --- packages: - standard_hw_audio: !include TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml + standard_hw_speaker: !include TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml esphome: platformio_options: @@ -38,8 +38,8 @@ script: #if !defined(TX_ULTIMATE_EASY_CORE) #error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required." #endif - #if !defined(TX_ULTIMATE_EASY_STANDARD_HW_AUDIO) - #error "The package TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml is required." + #if !defined(TX_ULTIMATE_EASY_STANDARD_HW_SPEAKER) + #error "The package TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml is required." #endif // Identify itself From 644ba8e7116fca252b2cb43f03793f680e85b05c Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 09:05:29 +0200 Subject: [PATCH 06/51] Add test against ESPHome Dev --- .github/workflows/validate_esphome_dev.yml | 210 +++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 .github/workflows/validate_esphome_dev.yml diff --git a/.github/workflows/validate_esphome_dev.yml b/.github/workflows/validate_esphome_dev.yml new file mode 100644 index 0000000..7c3d338 --- /dev/null +++ b/.github/workflows/validate_esphome_dev.yml @@ -0,0 +1,210 @@ +--- +name: Validate ESPHome (Dev) + +permissions: + contents: read + pull-requests: read + +on: # yamllint disable-line rule:truthy + push: + paths: + - "**/*.yml" + - "**/*.yaml" + - "**/*.h" + - "**/*.cpp" + - "**/*.c" + - "**/*.py" + + pull_request: + paths: + - "**/*.yml" + - "**/*.yaml" + - "**/*.h" + - "**/*.cpp" + - "**/*.c" + - "**/*.py" + + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + code_scan: + name: Code scan (YAML) + runs-on: "ubuntu-latest" + steps: + - name: Checkout Code + uses: actions/checkout@main + + - name: Setup Python + uses: actions/setup-python@main + with: + python-version: '3.8' + + - name: Install Yamllint + run: pip install yamllint + + - name: Validate YAML files + run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} + + + build_ard_core: + name: Core (Arduino) + needs: code_scan + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Core (Arduino) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_core.yaml" + version: dev + + build_idf_core: + name: Core (IDF) + needs: code_scan + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Core (IDF) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_core.yaml" + version: dev + + build_ard_basic: + name: Basic (Arduino) + needs: build_ard_core + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Basic (Arduino) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_basic.yaml" + version: dev + + build_idf_basic: + name: Basic (IDF) + needs: build_idf_core + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Basic (IDF) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_basic.yaml" + version: dev + + build_ard_hw_relays: + name: HW Relays (Arduino) + needs: build_ard_core + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build HW Relays (Arduino) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_hw_relays.yaml" + version: dev + + build_idf_hw_relays: + name: HW Relays (IDF) + needs: build_idf_core + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build HW Relays (IDF) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_hw_relays.yaml" + version: dev + + build_ard_hw_speaker: + name: HW Speaker (Arduino) + needs: build_ard_core + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build HW Speaker (Arduino) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_hw_speaker.yaml" + version: dev + + build_idf_hw_speaker: + name: HW Speaker (IDF) + needs: build_idf_core + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build HW Speaker (IDF) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_hw_speaker.yaml" + version: dev + + build_ard_hw_vibration: + name: HW Vibration (Arduino) + needs: build_ard_core + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build HW Vibration (Arduino) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_hw_vibration.yaml" + version: dev + + build_idf_hw_vibration: + name: HW Vibration (IDF) + needs: build_idf_core + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build HW Vibration (IDF) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_hw_vibration.yaml" + version: dev + + build_ard_ble_proxy: + name: Bluetooth Proxy (Ard) + needs: build_ard_basic + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build BLE Proxy (Ard) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_ble_proxy.yaml" + version: dev + + build_idf_ble_proxy: + name: Bluetooth Proxy (IDF) + needs: build_idf_basic + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build BLE Proxy (IDF) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_ble_proxy.yaml" + version: dev + + build_ard_media_player: + name: Media Player (Ard) + needs: + - build_ard_basic + - build_ard_hw_relays + - build_ard_hw_vibration + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Media Player (Ard) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_media_player.yaml" + version: dev +... From 97b193d7c338829c1cd80b6d2354b9743ba41112 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 09:15:49 +0200 Subject: [PATCH 07/51] Add notice about migration to ESP-IDF --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index c7f64d0..82cec00 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,45 @@ [buymeacoffee-shield]: https://img.shields.io/static/v1?label=Buy%20me%20an%20ice%20cream&message=❄&color=blue [buymeacoffee]: https://www.buymeacoffee.com/edwardfirmo +## Framework Migration to ESP-IDF + +> [!IMPORTANT] +> **ESP-IDF Framework Migration** +> +> Starting with version **2025.8.0**, TX Ultimate Easy will use **ESP-IDF** as the default framework, following ESPHome's direction towards ESP-IDF for better performance, stability, and feature support. +> +> **What this means for you:** +> - **New installations**: Will automatically use ESP-IDF (no action required) +> - **Existing Arduino users**: Can continue using Arduino but with limited support +> - **Migration recommended**: For better performance and full feature support +> +> **Arduino Framework Support:** +> - Still functional but **no longer actively tested** +> - **Limited support** will be provided for Arduino-specific issues +> - May miss out on new features optimized for ESP-IDF + +### Migration Guidelines + +#### For New Users +No action required - ESP-IDF will be used automatically. + +#### For Existing Arduino Users + +**Option 1: Migrate to ESP-IDF (Recommended)** +1. **Best practice**: Flash via serial/USB to ensure proper partition setup +2. **Alternative**: If serial flashing isn't possible, flash OTA twice consecutively to improve success rate + +**Option 2: Continue with Arduino** +Add this to your YAML configuration to force Arduino framework: +```yaml +esp32: + framework: + type: arduino +``` + +> [!WARNING] +> **Migration via OTA:** When switching frameworks via OTA, the partition table may not update correctly. Flash twice in succession to ensure both firmware partitions contain the latest firmware and prevent boot failures. + ## Integration with Home Assistant TX Ultimate Easy exposes your device's components (sensors, touch panel, relays, etc.) to Home Assistant, @@ -73,6 +112,7 @@ All device behaviors can be customized through Home Assistant automations withou - **BLE Proxy Support**: Optional Bluetooth Low Energy proxy functionality - **Audio Feedback**: Built-in speaker support for audible feedback - **Haptic Feedback**: Vibration motor support for tactile feedback +- **ESP-IDF Framework**: Enhanced performance and stability with ESP-IDF support ## Hardware Support From 50a11f61ffa692984cc688e0f46d03c39250dcd0 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 09:20:05 +0200 Subject: [PATCH 08/51] Removed `allow_other_uses` for pin 26 --- ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml index bebc6cf..2759029 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml @@ -66,7 +66,6 @@ switch: pin: number: GPIO26 inverted: true - allow_other_uses: true restore_mode: RESTORE_DEFAULT_ON internal: true entity_category: config From 7e070617ae01d1e8f277bd656239f5dc9e23a361 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 09:28:57 +0200 Subject: [PATCH 09/51] Rebuild `homeassistant.event` calls To support ESPHome 2025.8 --- ...X-Ultimate-Easy-ESPHome_core_hw_touch.yaml | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml index cf90e54..f4965ee 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml @@ -387,17 +387,16 @@ tx_ultimate_easy: on_multi_touch_release: then: + - homeassistant.event: + event: ${EVENT_NAME} + data: + device_name: !lambda return id(tx_device_name).state.c_str(); + firmware: ${version} + domain: touch + type: multi_touch + action: release + position: !lambda return std::to_string(touch.x); - lambda: |- - // Send event to Home Assistant - esphome::api::CustomAPIDevice ha_event; - ha_event.fire_homeassistant_event("${EVENT_NAME}", { - {"device_name", id(tx_device_name).state.c_str()}, - {"firmware", "${version}"}, - {"domain", "touch"}, - {"type", "multi_touch"}, - {"action", "release"}, - {"position", std::to_string(touch.x)} - }); ESP_LOGI("core_hw_touch", "Multi-touch released"); touch_on_multi_touch_release->execute(); @@ -419,39 +418,40 @@ tx_ultimate_easy: on_swipe_left: then: + - homeassistant.event: + event: ${EVENT_NAME} + data: + device_name: !lambda return id(tx_device_name).state.c_str(); + firmware: ${version} + domain: touch + type: swipe + action: !lambda return (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "left" : "down"; + swipe-direction: !lambda |- + return (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "left" : "down"; + position: !lambda return std::to_string(touch.x); - lambda: |- - std::string swipe_direction = (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "left" : "down"; - // Send event to Home Assistant - esphome::api::CustomAPIDevice ha_event; - ha_event.fire_homeassistant_event("${EVENT_NAME}", { - {"device_name", id(tx_device_name).state.c_str()}, - {"firmware", "${version}"}, - {"domain", "touch"}, - {"type", "swipe"}, - {"action", swipe_direction.c_str()}, - {"swipe-direction", swipe_direction.c_str()}, - {"position", std::to_string(touch.x)} - }); ESP_LOGI("core_hw_touch", "Multi-touch released"); touch_on_multi_touch_release->execute(); - ESP_LOGI("core_hw_touch", "Swipe %s", swipe_direction.c_str()); + ESP_LOGI("core_hw_touch", "Swipe %s", + (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "left" : "down"); touch_swipe_left->execute(); on_swipe_right: then: + - homeassistant.event: + event: ${EVENT_NAME} + data: + device_name: !lambda return id(tx_device_name).state.c_str(); + firmware: ${version} + domain: touch + type: swipe + action: !lambda return (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "right" : "up"; + swipe-direction: !lambda |- + return (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "right" : "up"; + position: !lambda return std::to_string(touch.x); - lambda: |- - std::string swipe_direction = (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "right" : "up"; - // Send event to Home Assistant - esphome::api::CustomAPIDevice ha_event; - ha_event.fire_homeassistant_event("${EVENT_NAME}", { - {"device_name", id(tx_device_name).state.c_str()}, - {"firmware", "${version}"}, - {"domain", "touch"}, - {"type", "swipe"}, - {"action", swipe_direction.c_str()}, - {"swipe-direction", swipe_direction.c_str()}, - {"position", std::to_string(touch.x)} - }); + ESP_LOGI("core_hw_touch", "Swipe %s", + (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "right" : "up"); ESP_LOGI("core_hw_touch", "Swipe %s", swipe_direction.c_str()); touch_swipe_right->execute(); From 5957e277b7a242ecb15e33f73258f538160b2983 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 09:31:35 +0200 Subject: [PATCH 10/51] Remove mapping on `!lambda` calls --- ...X-Ultimate-Easy-ESPHome_core_hw_touch.yaml | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml index f4965ee..a58e473 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml @@ -425,9 +425,16 @@ tx_ultimate_easy: firmware: ${version} domain: touch type: swipe - action: !lambda return (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "left" : "down"; + action: !lambda |- + if (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") + return "left"; + else + return "down"; swipe-direction: !lambda |- - return (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "left" : "down"; + if (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") + return "left"; + else + return "down"; position: !lambda return std::to_string(touch.x); - lambda: |- ESP_LOGI("core_hw_touch", "Multi-touch released"); @@ -445,9 +452,16 @@ tx_ultimate_easy: firmware: ${version} domain: touch type: swipe - action: !lambda return (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "right" : "up"; + action: !lambda |- + if (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") + return "right"; + else + return "up"; swipe-direction: !lambda |- - return (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "right" : "up"; + if (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") + return "right"; + else + return "up"; position: !lambda return std::to_string(touch.x); - lambda: |- ESP_LOGI("core_hw_touch", "Swipe %s", From 70a054616caaf684d4401ea023322c03a635e636 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 09:39:49 +0200 Subject: [PATCH 11/51] Remove old code --- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml index a58e473..577146c 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml @@ -466,7 +466,6 @@ tx_ultimate_easy: - lambda: |- ESP_LOGI("core_hw_touch", "Swipe %s", (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "right" : "up"); - ESP_LOGI("core_hw_touch", "Swipe %s", swipe_direction.c_str()); touch_swipe_right->execute(); on_touch_event: From 122cfff8db3a2159d777301f76edd099380b1336 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 09:50:19 +0200 Subject: [PATCH 12/51] Fix compiler key name --- ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml index e9d5c3b..0bfe4ad 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml @@ -38,7 +38,7 @@ api: esphome: platformio_options: build_flags: - - -D TX_ULTIMATE_EASY_STANDARD_SPEAKER + - -D TX_ULTIMATE_EASY_STANDARD_HW_SPEAKER number: - id: speaker_volume From 6d663323e589ed24ff27c65d9511cc178df0415c Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 10:06:46 +0200 Subject: [PATCH 13/51] Simplify tests in a matrix To make it easier to maintain --- .github/workflows/validate_esphome_dev.yml | 173 +++------------------ 1 file changed, 20 insertions(+), 153 deletions(-) diff --git a/.github/workflows/validate_esphome_dev.yml b/.github/workflows/validate_esphome_dev.yml index 7c3d338..bd527d5 100644 --- a/.github/workflows/validate_esphome_dev.yml +++ b/.github/workflows/validate_esphome_dev.yml @@ -49,162 +49,29 @@ jobs: - name: Validate YAML files run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} + - build_ard_core: - name: Core (Arduino) + build: needs: code_scan runs-on: ubuntu-latest + strategy: + matrix: + framework: [arduino, idf] + target: + - core + - basic + - hw_relays + - hw_speaker + - hw_vibration + include: + - framework: arduino + target: ble_proxy + - framework: idf + target: ble_proxy + - framework: arduino + target: media_player steps: - - uses: actions/checkout@main - - name: Build Core (Arduino) - uses: esphome/build-action@main + - uses: actions/checkout@v4 + - uses: esphome/build-action@vX with: - yaml-file: ".test/esphome_ard_core.yaml" - version: dev - - build_idf_core: - name: Core (IDF) - needs: code_scan - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Core (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_core.yaml" - version: dev - - build_ard_basic: - name: Basic (Arduino) - needs: build_ard_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Basic (Arduino) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_basic.yaml" - version: dev - - build_idf_basic: - name: Basic (IDF) - needs: build_idf_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Basic (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_basic.yaml" - version: dev - - build_ard_hw_relays: - name: HW Relays (Arduino) - needs: build_ard_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Relays (Arduino) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_hw_relays.yaml" - version: dev - - build_idf_hw_relays: - name: HW Relays (IDF) - needs: build_idf_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Relays (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_hw_relays.yaml" - version: dev - - build_ard_hw_speaker: - name: HW Speaker (Arduino) - needs: build_ard_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Speaker (Arduino) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_hw_speaker.yaml" - version: dev - - build_idf_hw_speaker: - name: HW Speaker (IDF) - needs: build_idf_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Speaker (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_hw_speaker.yaml" - version: dev - - build_ard_hw_vibration: - name: HW Vibration (Arduino) - needs: build_ard_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Vibration (Arduino) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_hw_vibration.yaml" - version: dev - - build_idf_hw_vibration: - name: HW Vibration (IDF) - needs: build_idf_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Vibration (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_hw_vibration.yaml" - version: dev - - build_ard_ble_proxy: - name: Bluetooth Proxy (Ard) - needs: build_ard_basic - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build BLE Proxy (Ard) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_ble_proxy.yaml" - version: dev - - build_idf_ble_proxy: - name: Bluetooth Proxy (IDF) - needs: build_idf_basic - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build BLE Proxy (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_ble_proxy.yaml" - version: dev - - build_ard_media_player: - name: Media Player (Ard) - needs: - - build_ard_basic - - build_ard_hw_relays - - build_ard_hw_vibration - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Media Player (Ard) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_media_player.yaml" + yaml-file: ".test/esphome_${{ matrix.framework }}_${{ matrix.target }}.yaml" version: dev ... From f9da91277745653b4c5ffd10a92d43fde545fe11 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 10:13:18 +0200 Subject: [PATCH 14/51] Test Media player under IDF and unify ESPHome tests --- .github/workflows/validate_esphome.yml | 180 ++--------------- .github/workflows/validate_esphome_beta.yml | 210 -------------------- .github/workflows/validate_esphome_dev.yml | 77 ------- .test/esphome_idf_media_player.yaml | 8 + 4 files changed, 26 insertions(+), 449 deletions(-) delete mode 100644 .github/workflows/validate_esphome_beta.yml delete mode 100644 .github/workflows/validate_esphome_dev.yml create mode 100644 .test/esphome_idf_media_player.yaml diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index 444fa08..680bef6 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -1,5 +1,5 @@ --- -name: Validate ESPHome (Latest) +name: Validate ESPHome permissions: contents: read @@ -15,178 +15,34 @@ concurrency: jobs: code_scan: name: Code scan (YAML) - runs-on: "ubuntu-latest" + runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@main - + uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@main + uses: actions/setup-python@v5 with: - python-version: '3.8' - + python-version: '3.11' - name: Install Yamllint run: pip install yamllint - - name: Validate YAML files run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} + - build_ard_core: - name: Core (Arduino) + build: + name: ${{ matrix.target }} (${{ matrix.framework }}) - ${{ matrix.version }} needs: code_scan runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + framework: [ard, idf] + version: [latest, beta, dev] + target: [core, basic, hw_relays, hw_speaker, hw_vibration, ble_proxy, media_player] steps: - - uses: actions/checkout@main - - name: Build Core (Arduino) - uses: esphome/build-action@main + - uses: actions/checkout@v4 + - name: Build ${{ matrix.target }} (${{ matrix.framework }}) - ${{ matrix.version }} + uses: esphome/build-action@v4 with: - yaml-file: ".test/esphome_ard_core.yaml" - version: latest - - build_idf_core: - name: Core (IDF) - needs: code_scan - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Core (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_core.yaml" - version: latest - - build_ard_basic: - name: Basic (Arduino) - needs: build_ard_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Basic (Arduino) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_basic.yaml" - version: latest - - build_idf_basic: - name: Basic (IDF) - needs: build_idf_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Basic (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_basic.yaml" - version: latest - - build_ard_hw_relays: - name: HW Relays (Arduino) - needs: build_ard_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Relays (Arduino) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_hw_relays.yaml" - version: latest - - build_idf_hw_relays: - name: HW Relays (IDF) - needs: build_idf_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Relays (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_hw_relays.yaml" - version: latest - - build_ard_hw_speaker: - name: HW Speaker (Arduino) - needs: build_ard_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Speaker (Arduino) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_hw_speaker.yaml" - version: latest - - build_idf_hw_speaker: - name: HW Speaker (IDF) - needs: build_idf_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Speaker (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_hw_speaker.yaml" - version: latest - - build_ard_hw_vibration: - name: HW Vibration (Arduino) - needs: build_ard_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Vibration (Arduino) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_hw_vibration.yaml" - version: latest - - build_idf_hw_vibration: - name: HW Vibration (IDF) - needs: build_idf_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Vibration (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_hw_vibration.yaml" - version: latest - - build_ard_ble_proxy: - name: Bluetooth Proxy (Ard) - needs: build_ard_basic - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build BLE Proxy (Ard) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_ble_proxy.yaml" - version: latest - - build_idf_ble_proxy: - name: Bluetooth Proxy (IDF) - needs: build_idf_basic - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build BLE Proxy (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_ble_proxy.yaml" - version: latest - - build_ard_media_player: - name: Media Player (Ard) - needs: - - build_ard_basic - - build_ard_hw_relays - - build_ard_hw_vibration - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Media Player (Ard) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_media_player.yaml" - version: latest + yaml-file: ".test/esphome_${{ matrix.framework }}_${{ matrix.target }}.yaml" + version: ${{ matrix.version }} ... diff --git a/.github/workflows/validate_esphome_beta.yml b/.github/workflows/validate_esphome_beta.yml deleted file mode 100644 index 970b307..0000000 --- a/.github/workflows/validate_esphome_beta.yml +++ /dev/null @@ -1,210 +0,0 @@ ---- -name: Validate ESPHome (Beta) - -permissions: - contents: read - pull-requests: read - -on: # yamllint disable-line rule:truthy - push: - paths: - - "**/*.yml" - - "**/*.yaml" - - "**/*.h" - - "**/*.cpp" - - "**/*.c" - - "**/*.py" - - pull_request: - paths: - - "**/*.yml" - - "**/*.yaml" - - "**/*.h" - - "**/*.cpp" - - "**/*.c" - - "**/*.py" - - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - code_scan: - name: Code scan (YAML) - runs-on: "ubuntu-latest" - steps: - - name: Checkout Code - uses: actions/checkout@main - - - name: Setup Python - uses: actions/setup-python@main - with: - python-version: '3.8' - - - name: Install Yamllint - run: pip install yamllint - - - name: Validate YAML files - run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} + - - build_ard_core: - name: Core (Arduino) - needs: code_scan - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Core (Arduino) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_core.yaml" - version: beta - - build_idf_core: - name: Core (IDF) - needs: code_scan - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Core (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_core.yaml" - version: beta - - build_ard_basic: - name: Basic (Arduino) - needs: build_ard_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Basic (Arduino) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_basic.yaml" - version: beta - - build_idf_basic: - name: Basic (IDF) - needs: build_idf_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Basic (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_basic.yaml" - version: beta - - build_ard_hw_relays: - name: HW Relays (Arduino) - needs: build_ard_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Relays (Arduino) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_hw_relays.yaml" - version: beta - - build_idf_hw_relays: - name: HW Relays (IDF) - needs: build_idf_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Relays (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_hw_relays.yaml" - version: beta - - build_ard_hw_speaker: - name: HW Speaker (Arduino) - needs: build_ard_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Speaker (Arduino) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_hw_speaker.yaml" - version: beta - - build_idf_hw_speaker: - name: HW Speaker (IDF) - needs: build_idf_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Speaker (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_hw_speaker.yaml" - version: beta - - build_ard_hw_vibration: - name: HW Vibration (Arduino) - needs: build_ard_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Vibration (Arduino) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_hw_vibration.yaml" - version: beta - - build_idf_hw_vibration: - name: HW Vibration (IDF) - needs: build_idf_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build HW Vibration (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_hw_vibration.yaml" - version: beta - - build_ard_ble_proxy: - name: Bluetooth Proxy (Ard) - needs: build_ard_basic - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build BLE Proxy (Ard) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_ble_proxy.yaml" - version: beta - - build_idf_ble_proxy: - name: Bluetooth Proxy (IDF) - needs: build_idf_basic - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build BLE Proxy (IDF) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_ble_proxy.yaml" - version: beta - - build_ard_media_player: - name: Media Player (Ard) - needs: - - build_ard_basic - - build_ard_hw_relays - - build_ard_hw_vibration - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Media Player (Ard) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_media_player.yaml" - version: beta -... diff --git a/.github/workflows/validate_esphome_dev.yml b/.github/workflows/validate_esphome_dev.yml deleted file mode 100644 index bd527d5..0000000 --- a/.github/workflows/validate_esphome_dev.yml +++ /dev/null @@ -1,77 +0,0 @@ ---- -name: Validate ESPHome (Dev) - -permissions: - contents: read - pull-requests: read - -on: # yamllint disable-line rule:truthy - push: - paths: - - "**/*.yml" - - "**/*.yaml" - - "**/*.h" - - "**/*.cpp" - - "**/*.c" - - "**/*.py" - - pull_request: - paths: - - "**/*.yml" - - "**/*.yaml" - - "**/*.h" - - "**/*.cpp" - - "**/*.c" - - "**/*.py" - - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - code_scan: - name: Code scan (YAML) - runs-on: "ubuntu-latest" - steps: - - name: Checkout Code - uses: actions/checkout@main - - - name: Setup Python - uses: actions/setup-python@main - with: - python-version: '3.8' - - - name: Install Yamllint - run: pip install yamllint - - - name: Validate YAML files - run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} + - - build: - needs: code_scan - runs-on: ubuntu-latest - strategy: - matrix: - framework: [arduino, idf] - target: - - core - - basic - - hw_relays - - hw_speaker - - hw_vibration - include: - - framework: arduino - target: ble_proxy - - framework: idf - target: ble_proxy - - framework: arduino - target: media_player - steps: - - uses: actions/checkout@v4 - - uses: esphome/build-action@vX - with: - yaml-file: ".test/esphome_${{ matrix.framework }}_${{ matrix.target }}.yaml" - version: dev -... diff --git a/.test/esphome_idf_media_player.yaml b/.test/esphome_idf_media_player.yaml new file mode 100644 index 0000000..b554651 --- /dev/null +++ b/.test/esphome_idf_media_player.yaml @@ -0,0 +1,8 @@ +--- +packages: + common_idf: !include common_idf.yaml + core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml + standard_hw_relays_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml + standard_hw_vibration_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_vibration.yaml + addon_media_player: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml +... From 66d1b27c0d12712b48e86e8623470a6b7f918cc6 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 10:15:41 +0200 Subject: [PATCH 15/51] Run tests on every push --- .github/workflows/validate_esphome.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index 680bef6..571ad8f 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -6,6 +6,24 @@ permissions: pull-requests: read on: # yamllint disable-line rule:truthy + push: + paths: + - "**/*.yml" + - "**/*.yaml" + - "**/*.h" + - "**/*.cpp" + - "**/*.c" + - "**/*.py" + + pull_request: + paths: + - "**/*.yml" + - "**/*.yaml" + - "**/*.h" + - "**/*.cpp" + - "**/*.c" + - "**/*.py" + workflow_dispatch: concurrency: From 982c64c1c1397284402a947e3b9d974ff48ee1a6 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 10:22:11 +0200 Subject: [PATCH 16/51] Use latest (`main`) for all actions --- .github/workflows/validate_esphome.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index 571ad8f..ce27d71 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -36,9 +36,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@main - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@main with: python-version: '3.11' - name: Install Yamllint @@ -57,9 +57,9 @@ jobs: version: [latest, beta, dev] target: [core, basic, hw_relays, hw_speaker, hw_vibration, ble_proxy, media_player] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@main - name: Build ${{ matrix.target }} (${{ matrix.framework }}) - ${{ matrix.version }} - uses: esphome/build-action@v4 + uses: esphome/build-action@main with: yaml-file: ".test/esphome_${{ matrix.framework }}_${{ matrix.target }}.yaml" version: ${{ matrix.version }} From 458273206d8de59cef165139f6fa1de7a8cc2e79 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 10:26:03 +0200 Subject: [PATCH 17/51] Test idf first --- .github/workflows/validate_esphome.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index ce27d71..a197351 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -53,7 +53,7 @@ jobs: strategy: fail-fast: false matrix: - framework: [ard, idf] + framework: [idf, ard] version: [latest, beta, dev] target: [core, basic, hw_relays, hw_speaker, hw_vibration, ble_proxy, media_player] steps: From a8277e5b88755ff4df3894793f394d522caf2e1b Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 10:33:56 +0200 Subject: [PATCH 18/51] Fail-fast tests --- .github/workflows/validate_esphome.yml | 119 +++++++++++++++++++++++-- 1 file changed, 113 insertions(+), 6 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index a197351..14b01e2 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -25,6 +25,22 @@ on: # yamllint disable-line rule:truthy - "**/*.py" workflow_dispatch: + inputs: + skip_features: + description: 'Skip feature builds (BLE proxy, media player)' + required: false + default: false + type: boolean + version_filter: + description: 'Test only specific version (latest, beta, dev, or all)' + required: false + default: 'all' + type: choice + options: + - all + - latest + - beta + - dev concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -46,16 +62,34 @@ jobs: - name: Validate YAML files run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} + - build: - name: ${{ matrix.target }} (${{ matrix.framework }}) - ${{ matrix.version }} - needs: code_scan + # Determine which versions to test based on input + setup_matrix: + name: Setup build matrix + runs-on: ubuntu-latest + outputs: + versions: ${{ steps.set-matrix.outputs.versions }} + steps: + - name: Set version matrix + id: set-matrix + run: | + if [ "${{ inputs.version_filter }}" == "all" ] || [ -z "${{ inputs.version_filter }}" ]; then + echo 'versions=["latest", "beta", "dev"]' >> $GITHUB_OUTPUT + else + echo 'versions=["${{ inputs.version_filter }}"]' >> $GITHUB_OUTPUT + fi + + # Stage 1: Essential builds - Must pass for everything else to continue + build_essential: + name: "📦 ${{ matrix.target }} (${{ matrix.framework }}-${{ matrix.version }})" + needs: [code_scan, setup_matrix] runs-on: ubuntu-latest strategy: - fail-fast: false + fail-fast: true # Stop all essential builds if any fail + max-parallel: 4 matrix: framework: [idf, ard] - version: [latest, beta, dev] - target: [core, basic, hw_relays, hw_speaker, hw_vibration, ble_proxy, media_player] + version: ${{ fromJson(needs.setup_matrix.outputs.versions) }} + target: [core, basic] steps: - uses: actions/checkout@main - name: Build ${{ matrix.target }} (${{ matrix.framework }}) - ${{ matrix.version }} @@ -63,4 +97,77 @@ jobs: with: yaml-file: ".test/esphome_${{ matrix.framework }}_${{ matrix.target }}.yaml" version: ${{ matrix.version }} + + # Stage 2: Hardware builds - Only if essential builds ALL passed + build_hardware: + name: "🔌 ${{ matrix.target }} (${{ matrix.framework }}-${{ matrix.version }})" + needs: [build_essential, setup_matrix] + if: success() # Explicit check that previous stage succeeded + runs-on: ubuntu-latest + strategy: + fail-fast: false # Hardware components can fail independently + max-parallel: 4 + matrix: + framework: [idf, ard] + version: ${{ fromJson(needs.setup_matrix.outputs.versions) }} + target: [hw_relays, hw_speaker, hw_vibration] + steps: + - uses: actions/checkout@main + - name: Build ${{ matrix.target }} (${{ matrix.framework }}) - ${{ matrix.version }} + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_${{ matrix.framework }}_${{ matrix.target }}.yaml" + version: ${{ matrix.version }} + + # Stage 3: Feature builds - Only if both previous stages passed and not skipped + build_features: + name: "⚡ ${{ matrix.target }} (${{ matrix.framework }}-${{ matrix.version }})" + needs: [build_essential, build_hardware, setup_matrix] + if: success() && !inputs.skip_features # Run only if previous stages passed AND not skipped + runs-on: ubuntu-latest + strategy: + fail-fast: false # Features can fail independently + max-parallel: 4 + matrix: + framework: [idf, ard] + version: ${{ fromJson(needs.setup_matrix.outputs.versions) }} + target: [ble_proxy, media_player] + steps: + - uses: actions/checkout@main + - name: Build ${{ matrix.target }} (${{ matrix.framework }}) - ${{ matrix.version }} + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_${{ matrix.framework }}_${{ matrix.target }}.yaml" + version: ${{ matrix.version }} + + # Results summary + build_summary: + name: "📊 Build Results Summary" + needs: [build_essential, build_hardware, build_features] + if: always() # Always run to show results, even if some stages failed + runs-on: ubuntu-latest + steps: + - name: Generate summary + run: | + echo "## 🔍 ESPHome Build Results" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "| Stage | Status | Result |" >> $GITHUB_STEP_SUMMARY + echo "|-------|--------|---------|" >> $GITHUB_STEP_SUMMARY + echo "| 📦 Essential | ${{ needs.build_essential.result }} | Core functionality builds |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 Hardware | ${{ needs.build_hardware.result }} | Hardware component builds |" >> $GITHUB_STEP_SUMMARY + echo "| ⚡ Features | ${{ needs.build_features.result }} | Advanced feature builds |" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + if [ "${{ needs.build_essential.result }}" != "success" ]; then + echo "❌ **Essential builds failed** - Check core and basic configurations" >> $GITHUB_STEP_SUMMARY + exit 1 + elif [ "${{ needs.build_hardware.result }}" != "success" ] && [ "${{ needs.build_hardware.result }}" != "skipped" ]; then + echo "⚠️ **Hardware builds failed** - Essential builds passed but hardware components have issues" >> $GITHUB_STEP_SUMMARY + exit 1 + elif [ "${{ needs.build_features.result }}" != "success" ] && [ "${{ needs.build_features.result }}" != "skipped" ]; then + echo "⚠️ **Feature builds failed** - Core functionality works but advanced features have issues" >> $GITHUB_STEP_SUMMARY + exit 1 + else + echo "✅ **All builds completed successfully!** 🎉" >> $GITHUB_STEP_SUMMARY + fi ... From 78d820d91eed4faa3efe96de9346d62e3f6d6fb6 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 10:35:11 +0200 Subject: [PATCH 19/51] Remove BLE proxy addon --- .test/esphome_idf_ble_proxy.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.test/esphome_idf_ble_proxy.yaml b/.test/esphome_idf_ble_proxy.yaml index 58eeda2..844ed48 100644 --- a/.test/esphome_idf_ble_proxy.yaml +++ b/.test/esphome_idf_ble_proxy.yaml @@ -3,7 +3,6 @@ packages: common: !include common.yaml core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml standard_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml - addon_bluetooth_proxy: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml bluetooth_proxy: ... From 669a78a427235904e9058b68475d2d5ee3c71543 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 10:39:06 +0200 Subject: [PATCH 20/51] Reorg tests --- .github/workflows/validate_esphome.yml | 76 ++++++++++++++++++-------- 1 file changed, 54 insertions(+), 22 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index 14b01e2..b5fca07 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -78,31 +78,30 @@ jobs: echo 'versions=["${{ inputs.version_filter }}"]' >> $GITHUB_OUTPUT fi - # Stage 1: Essential builds - Must pass for everything else to continue - build_essential: - name: "📦 ${{ matrix.target }} (${{ matrix.framework }}-${{ matrix.version }})" + # Stage 1: Core builds - Foundation (must pass for everything else to continue) + build_core: + name: "🏗️ Core (${{ matrix.framework }}-${{ matrix.version }})" needs: [code_scan, setup_matrix] runs-on: ubuntu-latest strategy: - fail-fast: true # Stop all essential builds if any fail + fail-fast: true # If core fails, stop everything max-parallel: 4 matrix: framework: [idf, ard] version: ${{ fromJson(needs.setup_matrix.outputs.versions) }} - target: [core, basic] steps: - uses: actions/checkout@main - - name: Build ${{ matrix.target }} (${{ matrix.framework }}) - ${{ matrix.version }} + - name: Build Core (${{ matrix.framework }}) - ${{ matrix.version }} uses: esphome/build-action@main with: - yaml-file: ".test/esphome_${{ matrix.framework }}_${{ matrix.target }}.yaml" + yaml-file: ".test/esphome_${{ matrix.framework }}_core.yaml" version: ${{ matrix.version }} - # Stage 2: Hardware builds - Only if essential builds ALL passed + # Stage 2: Hardware builds - Individual components (only if core passed) build_hardware: name: "🔌 ${{ matrix.target }} (${{ matrix.framework }}-${{ matrix.version }})" - needs: [build_essential, setup_matrix] - if: success() # Explicit check that previous stage succeeded + needs: [build_core, setup_matrix] + if: success() # Only run if core builds passed runs-on: ubuntu-latest strategy: fail-fast: false # Hardware components can fail independently @@ -119,11 +118,31 @@ jobs: yaml-file: ".test/esphome_${{ matrix.framework }}_${{ matrix.target }}.yaml" version: ${{ matrix.version }} - # Stage 3: Feature builds - Only if both previous stages passed and not skipped + # Stage 3: Basic builds - Integrated functionality (needs core + hardware) + build_basic: + name: "📦 Basic (${{ matrix.framework }}-${{ matrix.version }})" + needs: [build_core, build_hardware, setup_matrix] + if: success() # Only run if both core and hardware passed + runs-on: ubuntu-latest + strategy: + fail-fast: true # Basic should pass if hardware works + max-parallel: 4 + matrix: + framework: [idf, ard] + version: ${{ fromJson(needs.setup_matrix.outputs.versions) }} + steps: + - uses: actions/checkout@main + - name: Build Basic (${{ matrix.framework }}) - ${{ matrix.version }} + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_${{ matrix.framework }}_basic.yaml" + version: ${{ matrix.version }} + + # Stage 4: Feature builds - Advanced functionality (needs everything before) build_features: name: "⚡ ${{ matrix.target }} (${{ matrix.framework }}-${{ matrix.version }})" - needs: [build_essential, build_hardware, setup_matrix] - if: success() && !inputs.skip_features # Run only if previous stages passed AND not skipped + needs: [build_core, build_hardware, build_basic, setup_matrix] + if: success() && !inputs.skip_features # Run only if all previous stages passed AND not skipped runs-on: ubuntu-latest strategy: fail-fast: false # Features can fail independently @@ -143,7 +162,7 @@ jobs: # Results summary build_summary: name: "📊 Build Results Summary" - needs: [build_essential, build_hardware, build_features] + needs: [build_core, build_hardware, build_basic, build_features] if: always() # Always run to show results, even if some stages failed runs-on: ubuntu-latest steps: @@ -151,23 +170,36 @@ jobs: run: | echo "## 🔍 ESPHome Build Results" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "| Stage | Status | Result |" >> $GITHUB_STEP_SUMMARY - echo "|-------|--------|---------|" >> $GITHUB_STEP_SUMMARY - echo "| 📦 Essential | ${{ needs.build_essential.result }} | Core functionality builds |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 Hardware | ${{ needs.build_hardware.result }} | Hardware component builds |" >> $GITHUB_STEP_SUMMARY - echo "| ⚡ Features | ${{ needs.build_features.result }} | Advanced feature builds |" >> $GITHUB_STEP_SUMMARY + echo "**Dependency Chain:** code_scan → core → hardware → basic → features" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "| Stage | Status | Description |" >> $GITHUB_STEP_SUMMARY + echo "|-------|--------|-------------|" >> $GITHUB_STEP_SUMMARY + echo "| 🏗️ Core | ${{ needs.build_core.result }} | Foundation components (must pass for all others) |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 Hardware | ${{ needs.build_hardware.result }} | Individual hardware components |" >> $GITHUB_STEP_SUMMARY + echo "| 📦 Basic | ${{ needs.build_basic.result }} | Integrated core + hardware functionality |" >> $GITHUB_STEP_SUMMARY + echo "| ⚡ Features | ${{ needs.build_features.result }} | Advanced features (BLE, media player) |" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - if [ "${{ needs.build_essential.result }}" != "success" ]; then - echo "❌ **Essential builds failed** - Check core and basic configurations" >> $GITHUB_STEP_SUMMARY + # Determine overall result and provide guidance + if [ "${{ needs.build_core.result }}" != "success" ]; then + echo "❌ **Core builds failed** - Fundamental issue with core components" >> $GITHUB_STEP_SUMMARY + echo "🔧 **Next steps:** Check core YAML configuration and basic component definitions" >> $GITHUB_STEP_SUMMARY exit 1 elif [ "${{ needs.build_hardware.result }}" != "success" ] && [ "${{ needs.build_hardware.result }}" != "skipped" ]; then - echo "⚠️ **Hardware builds failed** - Essential builds passed but hardware components have issues" >> $GITHUB_STEP_SUMMARY + echo "⚠️ **Hardware builds failed** - Core works but hardware components have issues" >> $GITHUB_STEP_SUMMARY + echo "🔧 **Next steps:** Check relay, speaker, or vibration component configurations" >> $GITHUB_STEP_SUMMARY + exit 1 + elif [ "${{ needs.build_basic.result }}" != "success" ] && [ "${{ needs.build_basic.result }}" != "skipped" ]; then + echo "⚠️ **Basic builds failed** - Hardware works individually but integration has issues" >> $GITHUB_STEP_SUMMARY + echo "🔧 **Next steps:** Check how hardware components are integrated in basic configuration" >> $GITHUB_STEP_SUMMARY exit 1 elif [ "${{ needs.build_features.result }}" != "success" ] && [ "${{ needs.build_features.result }}" != "skipped" ]; then echo "⚠️ **Feature builds failed** - Core functionality works but advanced features have issues" >> $GITHUB_STEP_SUMMARY + echo "🔧 **Next steps:** Check BLE proxy or media player specific configurations" >> $GITHUB_STEP_SUMMARY exit 1 else echo "✅ **All builds completed successfully!** 🎉" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "🚀 **Ready for release** - All components tested and working" >> $GITHUB_STEP_SUMMARY fi ... From 2cc81995931e28c5dd57d9004d1b7112f115d297 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 10:46:41 +0200 Subject: [PATCH 21/51] No limits on the core tests --- .github/workflows/validate_esphome.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index b5fca07..5143040 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -85,7 +85,7 @@ jobs: runs-on: ubuntu-latest strategy: fail-fast: true # If core fails, stop everything - max-parallel: 4 + # max-parallel: 4 matrix: framework: [idf, ard] version: ${{ fromJson(needs.setup_matrix.outputs.versions) }} From 54c9119a63001e5166061594412a47ae2aa5c807 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 14:45:52 +0200 Subject: [PATCH 22/51] Test basic first --- .github/workflows/validate_esphome.yml | 212 +++++++++++++------------ 1 file changed, 110 insertions(+), 102 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index 5143040..5673218 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -26,21 +26,11 @@ on: # yamllint disable-line rule:truthy workflow_dispatch: inputs: - skip_features: - description: 'Skip feature builds (BLE proxy, media player)' + skip_dev: + description: 'Skip dev testing (test only on latest)' required: false default: false type: boolean - version_filter: - description: 'Test only specific version (latest, beta, dev, or all)' - required: false - default: 'all' - type: choice - options: - - all - - latest - - beta - - dev concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -62,144 +52,162 @@ jobs: - name: Validate YAML files run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} + - # Determine which versions to test based on input - setup_matrix: - name: Setup build matrix - runs-on: ubuntu-latest - outputs: - versions: ${{ steps.set-matrix.outputs.versions }} - steps: - - name: Set version matrix - id: set-matrix - run: | - if [ "${{ inputs.version_filter }}" == "all" ] || [ -z "${{ inputs.version_filter }}" ]; then - echo 'versions=["latest", "beta", "dev"]' >> $GITHUB_OUTPUT - else - echo 'versions=["${{ inputs.version_filter }}"]' >> $GITHUB_OUTPUT - fi - - # Stage 1: Core builds - Foundation (must pass for everything else to continue) + # Foundation Testing - Latest only (fast, stable) build_core: - name: "🏗️ Core (${{ matrix.framework }}-${{ matrix.version }})" - needs: [code_scan, setup_matrix] + name: "🏗️ Core (${{ matrix.framework }})" + needs: code_scan runs-on: ubuntu-latest strategy: - fail-fast: true # If core fails, stop everything - # max-parallel: 4 + fail-fast: true + max-parallel: 2 matrix: framework: [idf, ard] - version: ${{ fromJson(needs.setup_matrix.outputs.versions) }} steps: - uses: actions/checkout@main - - name: Build Core (${{ matrix.framework }}) - ${{ matrix.version }} + - name: Build Core uses: esphome/build-action@main with: yaml-file: ".test/esphome_${{ matrix.framework }}_core.yaml" - version: ${{ matrix.version }} + version: latest - # Stage 2: Hardware builds - Individual components (only if core passed) - build_hardware: - name: "🔌 ${{ matrix.target }} (${{ matrix.framework }}-${{ matrix.version }})" - needs: [build_core, setup_matrix] - if: success() # Only run if core builds passed + build_basic: + name: "📦 Basic (${{ matrix.framework }})" + needs: build_core + if: success() runs-on: ubuntu-latest strategy: - fail-fast: false # Hardware components can fail independently + fail-fast: true + max-parallel: 2 + matrix: + framework: [idf, ard] + steps: + - uses: actions/checkout@main + - name: Build Basic + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_${{ matrix.framework }}_basic.yaml" + version: latest + + build_hardware: + name: "🔌 ${{ matrix.target }} (${{ matrix.framework }})" + needs: [build_core, build_basic] + if: success() + runs-on: ubuntu-latest + strategy: + fail-fast: false max-parallel: 4 matrix: framework: [idf, ard] - version: ${{ fromJson(needs.setup_matrix.outputs.versions) }} target: [hw_relays, hw_speaker, hw_vibration] steps: - uses: actions/checkout@main - - name: Build ${{ matrix.target }} (${{ matrix.framework }}) - ${{ matrix.version }} + - name: Build Hardware uses: esphome/build-action@main with: yaml-file: ".test/esphome_${{ matrix.framework }}_${{ matrix.target }}.yaml" - version: ${{ matrix.version }} + version: latest - # Stage 3: Basic builds - Integrated functionality (needs core + hardware) - build_basic: - name: "📦 Basic (${{ matrix.framework }}-${{ matrix.version }})" - needs: [build_core, build_hardware, setup_matrix] - if: success() # Only run if both core and hardware passed + build_features: + name: "⚡ ${{ matrix.target }} (${{ matrix.framework }})" + needs: [build_core, build_basic, build_hardware] + if: success() runs-on: ubuntu-latest strategy: - fail-fast: true # Basic should pass if hardware works + fail-fast: false max-parallel: 4 matrix: framework: [idf, ard] - version: ${{ fromJson(needs.setup_matrix.outputs.versions) }} + target: [ble_proxy, media_player] steps: - uses: actions/checkout@main - - name: Build Basic (${{ matrix.framework }}) - ${{ matrix.version }} + - name: Build Features + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_${{ matrix.framework }}_${{ matrix.target }}.yaml" + version: latest + + # Comprehensive Testing - Only after everything works + # Test complete system on latest (stable) + dev (bleeding edge) + build_comprehensive: + name: "🌍 Complete (${{ matrix.framework }}-${{ matrix.version }})" + needs: [build_core, build_basic, build_hardware, build_features] + if: success() && !inputs.skip_dev + runs-on: ubuntu-latest + strategy: + fail-fast: false + max-parallel: 4 + matrix: + framework: [idf, ard] + version: [latest, dev] # Only two versions: stable + cutting-edge + steps: + - uses: actions/checkout@main + - name: Build Complete System uses: esphome/build-action@main with: yaml-file: ".test/esphome_${{ matrix.framework }}_basic.yaml" version: ${{ matrix.version }} - # Stage 4: Feature builds - Advanced functionality (needs everything before) - build_features: - name: "⚡ ${{ matrix.target }} (${{ matrix.framework }}-${{ matrix.version }})" - needs: [build_core, build_hardware, build_basic, setup_matrix] - if: success() && !inputs.skip_features # Run only if all previous stages passed AND not skipped - runs-on: ubuntu-latest - strategy: - fail-fast: false # Features can fail independently - max-parallel: 4 - matrix: - framework: [idf, ard] - version: ${{ fromJson(needs.setup_matrix.outputs.versions) }} - target: [ble_proxy, media_player] - steps: - - uses: actions/checkout@main - - name: Build ${{ matrix.target }} (${{ matrix.framework }}) - ${{ matrix.version }} - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_${{ matrix.framework }}_${{ matrix.target }}.yaml" - version: ${{ matrix.version }} - - # Results summary build_summary: - name: "📊 Build Results Summary" - needs: [build_core, build_hardware, build_basic, build_features] - if: always() # Always run to show results, even if some stages failed + name: "📊 Summary" + needs: [build_core, build_basic, build_hardware, build_features, build_comprehensive] + if: always() runs-on: ubuntu-latest steps: - - name: Generate summary + - name: Results run: | - echo "## 🔍 ESPHome Build Results" >> $GITHUB_STEP_SUMMARY + echo "## 📋 Build Summary" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "**Dependency Chain:** code_scan → core → hardware → basic → features" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "| Stage | Status | Description |" >> $GITHUB_STEP_SUMMARY - echo "|-------|--------|-------------|" >> $GITHUB_STEP_SUMMARY - echo "| 🏗️ Core | ${{ needs.build_core.result }} | Foundation components (must pass for all others) |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 Hardware | ${{ needs.build_hardware.result }} | Individual hardware components |" >> $GITHUB_STEP_SUMMARY - echo "| 📦 Basic | ${{ needs.build_basic.result }} | Integrated core + hardware functionality |" >> $GITHUB_STEP_SUMMARY - echo "| ⚡ Features | ${{ needs.build_features.result }} | Advanced features (BLE, media player) |" >> $GITHUB_STEP_SUMMARY + echo "**Strategy: Foundation on stable, validation on stable + dev**" >> $GITHUB_STEP_SUMMARY + echo "**Build Order: Core → Basic → Hardware → Features → Complete**" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - # Determine overall result and provide guidance + # Build counts + FOUNDATION_BUILDS=14 # 2+2+6+4 + COMPREHENSIVE_BUILDS=4 # 2 frameworks × 2 versions + + if [ "${{ needs.build_comprehensive.result }}" == "skipped" ]; then + TOTAL=$FOUNDATION_BUILDS + echo "**Builds run:** $TOTAL (foundation only)" >> $GITHUB_STEP_SUMMARY + else + TOTAL=$((FOUNDATION_BUILDS + COMPREHENSIVE_BUILDS)) + echo "**Builds run:** $TOTAL ($FOUNDATION_BUILDS foundation + $COMPREHENSIVE_BUILDS comprehensive)" >> $GITHUB_STEP_SUMMARY + fi + + echo "**Efficiency:** $((100 - (TOTAL * 100 / 42)))% fewer builds than full matrix" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + # Results + echo "| Stage | Result |" >> $GITHUB_STEP_SUMMARY + echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY + echo "| 🏗️ Foundation | ${{ needs.build_core.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 📦 Basic (Most Common) | ${{ needs.build_basic.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 Hardware | ${{ needs.build_hardware.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| ⚡ Features | ${{ needs.build_features.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 🌍 Multi-version | ${{ needs.build_comprehensive.result }} |" >> $GITHUB_STEP_SUMMARY + + # Final status if [ "${{ needs.build_core.result }}" != "success" ]; then - echo "❌ **Core builds failed** - Fundamental issue with core components" >> $GITHUB_STEP_SUMMARY - echo "🔧 **Next steps:** Check core YAML configuration and basic component definitions" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "❌ **Core foundation failed** - Fix core components first" >> $GITHUB_STEP_SUMMARY exit 1 - elif [ "${{ needs.build_hardware.result }}" != "success" ] && [ "${{ needs.build_hardware.result }}" != "skipped" ]; then - echo "⚠️ **Hardware builds failed** - Core works but hardware components have issues" >> $GITHUB_STEP_SUMMARY - echo "🔧 **Next steps:** Check relay, speaker, or vibration component configurations" >> $GITHUB_STEP_SUMMARY + elif [ "${{ needs.build_basic.result }}" != "success" ]; then + echo "" >> $GITHUB_STEP_SUMMARY + echo "❌ **Basic build failed** - Most common configuration has issues" >> $GITHUB_STEP_SUMMARY exit 1 - elif [ "${{ needs.build_basic.result }}" != "success" ] && [ "${{ needs.build_basic.result }}" != "skipped" ]; then - echo "⚠️ **Basic builds failed** - Hardware works individually but integration has issues" >> $GITHUB_STEP_SUMMARY - echo "🔧 **Next steps:** Check how hardware components are integrated in basic configuration" >> $GITHUB_STEP_SUMMARY + elif [ "${{ needs.build_hardware.result }}" != "success" ]; then + echo "" >> $GITHUB_STEP_SUMMARY + echo "❌ **Hardware builds failed** - Individual components have issues" >> $GITHUB_STEP_SUMMARY exit 1 - elif [ "${{ needs.build_features.result }}" != "success" ] && [ "${{ needs.build_features.result }}" != "skipped" ]; then - echo "⚠️ **Feature builds failed** - Core functionality works but advanced features have issues" >> $GITHUB_STEP_SUMMARY - echo "🔧 **Next steps:** Check BLE proxy or media player specific configurations" >> $GITHUB_STEP_SUMMARY + elif [ "${{ needs.build_features.result }}" != "success" ]; then + echo "" >> $GITHUB_STEP_SUMMARY + echo "❌ **Feature builds failed** - Advanced features have issues" >> $GITHUB_STEP_SUMMARY + exit 1 + elif [ "${{ needs.build_comprehensive.result }}" == "failure" ]; then + echo "" >> $GITHUB_STEP_SUMMARY + echo "⚠️ **Multi-version testing failed** - Works on latest, issues with dev" >> $GITHUB_STEP_SUMMARY exit 1 else - echo "✅ **All builds completed successfully!** 🎉" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "🚀 **Ready for release** - All components tested and working" >> $GITHUB_STEP_SUMMARY + echo "✅ **All builds passed!** Ready for production 🚀" >> $GITHUB_STEP_SUMMARY fi ... From bd863714533455ac872fa4b562a6dc3b98bc3cea Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 14:48:06 +0200 Subject: [PATCH 23/51] Lint --- .github/workflows/validate_esphome.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index 5673218..a70674b 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -160,11 +160,11 @@ jobs: echo "**Strategy: Foundation on stable, validation on stable + dev**" >> $GITHUB_STEP_SUMMARY echo "**Build Order: Core → Basic → Hardware → Features → Complete**" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - + # Build counts FOUNDATION_BUILDS=14 # 2+2+6+4 COMPREHENSIVE_BUILDS=4 # 2 frameworks × 2 versions - + if [ "${{ needs.build_comprehensive.result }}" == "skipped" ]; then TOTAL=$FOUNDATION_BUILDS echo "**Builds run:** $TOTAL (foundation only)" >> $GITHUB_STEP_SUMMARY @@ -172,10 +172,10 @@ jobs: TOTAL=$((FOUNDATION_BUILDS + COMPREHENSIVE_BUILDS)) echo "**Builds run:** $TOTAL ($FOUNDATION_BUILDS foundation + $COMPREHENSIVE_BUILDS comprehensive)" >> $GITHUB_STEP_SUMMARY fi - + echo "**Efficiency:** $((100 - (TOTAL * 100 / 42)))% fewer builds than full matrix" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - + # Results echo "| Stage | Result |" >> $GITHUB_STEP_SUMMARY echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY @@ -184,7 +184,7 @@ jobs: echo "| 🔌 Hardware | ${{ needs.build_hardware.result }} |" >> $GITHUB_STEP_SUMMARY echo "| ⚡ Features | ${{ needs.build_features.result }} |" >> $GITHUB_STEP_SUMMARY echo "| 🌍 Multi-version | ${{ needs.build_comprehensive.result }} |" >> $GITHUB_STEP_SUMMARY - + # Final status if [ "${{ needs.build_core.result }}" != "success" ]; then echo "" >> $GITHUB_STEP_SUMMARY From 9fdfd52ad4e3bf1b84a919e19f76a95113ec0d67 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 14:58:48 +0200 Subject: [PATCH 24/51] Resolve conflict with PR#116 --- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml index 577146c..0bf617c 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml @@ -437,8 +437,6 @@ tx_ultimate_easy: return "down"; position: !lambda return std::to_string(touch.x); - lambda: |- - ESP_LOGI("core_hw_touch", "Multi-touch released"); - touch_on_multi_touch_release->execute(); ESP_LOGI("core_hw_touch", "Swipe %s", (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "left" : "down"); touch_swipe_left->execute(); From 54ac959abb7d1caf578a8302bfb492f8098cb4e5 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 15:07:06 +0200 Subject: [PATCH 25/51] Org test back on platform-centric --- .github/workflows/validate_esphome.yml | 366 ++++++++++++++++++------- 1 file changed, 261 insertions(+), 105 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index a70674b..0e2c8fb 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -52,162 +52,318 @@ jobs: - name: Validate YAML files run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} + - # Foundation Testing - Latest only (fast, stable) - build_core: - name: "🏗️ Core (${{ matrix.framework }})" + # Arduino Framework - Foundation + build_ard_core: + name: "🏗️ Arduino Core" needs: code_scan runs-on: ubuntu-latest - strategy: - fail-fast: true - max-parallel: 2 - matrix: - framework: [idf, ard] steps: - uses: actions/checkout@main - - name: Build Core + - name: Build Arduino Core uses: esphome/build-action@main with: - yaml-file: ".test/esphome_${{ matrix.framework }}_core.yaml" + yaml-file: ".test/esphome_ard_core.yaml" version: latest - build_basic: - name: "📦 Basic (${{ matrix.framework }})" - needs: build_core - if: success() + build_ard_basic: + name: "📦 Arduino Basic" + needs: build_ard_core runs-on: ubuntu-latest - strategy: - fail-fast: true - max-parallel: 2 - matrix: - framework: [idf, ard] steps: - uses: actions/checkout@main - - name: Build Basic + - name: Build Arduino Basic uses: esphome/build-action@main with: - yaml-file: ".test/esphome_${{ matrix.framework }}_basic.yaml" + yaml-file: ".test/esphome_ard_basic.yaml" version: latest - build_hardware: - name: "🔌 ${{ matrix.target }} (${{ matrix.framework }})" - needs: [build_core, build_basic] - if: success() + build_ard_hw_relays: + name: "🔌 Arduino HW Relays" + needs: [build_ard_core, build_ard_basic] runs-on: ubuntu-latest - strategy: - fail-fast: false - max-parallel: 4 - matrix: - framework: [idf, ard] - target: [hw_relays, hw_speaker, hw_vibration] steps: - uses: actions/checkout@main - - name: Build Hardware + - name: Build Arduino HW Relays uses: esphome/build-action@main with: - yaml-file: ".test/esphome_${{ matrix.framework }}_${{ matrix.target }}.yaml" + yaml-file: ".test/esphome_ard_hw_relays.yaml" version: latest - build_features: - name: "⚡ ${{ matrix.target }} (${{ matrix.framework }})" - needs: [build_core, build_basic, build_hardware] - if: success() + build_ard_hw_speaker: + name: "🔌 Arduino HW Speaker" + needs: [build_ard_core, build_ard_basic] runs-on: ubuntu-latest - strategy: - fail-fast: false - max-parallel: 4 - matrix: - framework: [idf, ard] - target: [ble_proxy, media_player] steps: - uses: actions/checkout@main - - name: Build Features + - name: Build Arduino HW Speaker uses: esphome/build-action@main with: - yaml-file: ".test/esphome_${{ matrix.framework }}_${{ matrix.target }}.yaml" + yaml-file: ".test/esphome_ard_hw_speaker.yaml" version: latest - # Comprehensive Testing - Only after everything works - # Test complete system on latest (stable) + dev (bleeding edge) - build_comprehensive: - name: "🌍 Complete (${{ matrix.framework }}-${{ matrix.version }})" - needs: [build_core, build_basic, build_hardware, build_features] + build_ard_hw_vibration: + name: "🔌 Arduino HW Vibration" + needs: [build_ard_core, build_ard_basic] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Arduino HW Vibration + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_hw_vibration.yaml" + version: latest + + build_ard_ble_proxy: + name: "⚡ Arduino BLE Proxy" + needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Arduino BLE Proxy + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_ble_proxy.yaml" + version: latest + + build_ard_media_player: + name: "⚡ Arduino Media Player" + needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Arduino Media Player + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_media_player.yaml" + version: latest + + # IDF Framework - Foundation + build_idf_core: + name: "🏗️ IDF Core" + needs: code_scan + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build IDF Core + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_core.yaml" + version: latest + + build_idf_basic: + name: "📦 IDF Basic" + needs: build_idf_core + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build IDF Basic + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_basic.yaml" + version: latest + + build_idf_hw_relays: + name: "🔌 IDF HW Relays" + needs: [build_idf_core, build_idf_basic] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build IDF HW Relays + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_hw_relays.yaml" + version: latest + + build_idf_hw_speaker: + name: "🔌 IDF HW Speaker" + needs: [build_idf_core, build_idf_basic] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build IDF HW Speaker + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_hw_speaker.yaml" + version: latest + + build_idf_hw_vibration: + name: "🔌 IDF HW Vibration" + needs: [build_idf_core, build_idf_basic] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build IDF HW Vibration + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_hw_vibration.yaml" + version: latest + + build_idf_ble_proxy: + name: "⚡ IDF BLE Proxy" + needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build IDF BLE Proxy + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_ble_proxy.yaml" + version: latest + + build_idf_media_player: + name: "⚡ IDF Media Player" + needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build IDF Media Player + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_media_player.yaml" + version: latest + + # Comprehensive Testing - Multi-version validation + build_comprehensive_ard_latest: + name: "🌍 Arduino Complete (latest)" + needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration, build_ard_ble_proxy, build_ard_media_player] if: success() && !inputs.skip_dev runs-on: ubuntu-latest - strategy: - fail-fast: false - max-parallel: 4 - matrix: - framework: [idf, ard] - version: [latest, dev] # Only two versions: stable + cutting-edge steps: - uses: actions/checkout@main - - name: Build Complete System + - name: Build Arduino Complete - latest uses: esphome/build-action@main with: - yaml-file: ".test/esphome_${{ matrix.framework }}_basic.yaml" - version: ${{ matrix.version }} + yaml-file: ".test/esphome_ard_basic.yaml" + version: latest + build_comprehensive_ard_dev: + name: "🌍 Arduino Complete (dev)" + needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration, build_ard_ble_proxy, build_ard_media_player] + if: success() && !inputs.skip_dev + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Arduino Complete - dev + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_basic.yaml" + version: dev + + build_comprehensive_idf_latest: + name: "🌍 IDF Complete (latest)" + needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration, build_idf_ble_proxy, build_idf_media_player] + if: success() && !inputs.skip_dev + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build IDF Complete - latest + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_basic.yaml" + version: latest + + build_comprehensive_idf_dev: + name: "🌍 IDF Complete (dev)" + needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration, build_idf_ble_proxy, build_idf_media_player] + if: success() && !inputs.skip_dev + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build IDF Complete - dev + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_basic.yaml" + version: dev + + # Results summary build_summary: - name: "📊 Summary" - needs: [build_core, build_basic, build_hardware, build_features, build_comprehensive] + name: "📊 Build Summary" + needs: + - build_ard_core + - build_ard_basic + - build_ard_hw_relays + - build_ard_hw_speaker + - build_ard_hw_vibration + - build_ard_ble_proxy + - build_ard_media_player + - build_idf_core + - build_idf_basic + - build_idf_hw_relays + - build_idf_hw_speaker + - build_idf_hw_vibration + - build_idf_ble_proxy + - build_idf_media_player + - build_comprehensive_ard_latest + - build_comprehensive_ard_dev + - build_comprehensive_idf_latest + - build_comprehensive_idf_dev if: always() runs-on: ubuntu-latest steps: - - name: Results + - name: Generate Results Summary run: | - echo "## 📋 Build Summary" >> $GITHUB_STEP_SUMMARY + echo "## 📋 ESPHome Build Results" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "**Strategy: Foundation on stable, validation on stable + dev**" >> $GITHUB_STEP_SUMMARY - echo "**Build Order: Core → Basic → Hardware → Features → Complete**" >> $GITHUB_STEP_SUMMARY + echo "**Strategy:** Framework-specific dependency chains with independent failure paths" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - # Build counts - FOUNDATION_BUILDS=14 # 2+2+6+4 - COMPREHENSIVE_BUILDS=4 # 2 frameworks × 2 versions + # Arduino Results + echo "### 🤖 Arduino Framework" >> $GITHUB_STEP_SUMMARY + echo "| Component | Status |" >> $GITHUB_STEP_SUMMARY + echo "|-----------|--------|" >> $GITHUB_STEP_SUMMARY + echo "| 🏗️ Core | ${{ needs.build_ard_core.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 📦 Basic | ${{ needs.build_ard_basic.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 HW Relays | ${{ needs.build_ard_hw_relays.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 HW Speaker | ${{ needs.build_ard_hw_speaker.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 HW Vibration | ${{ needs.build_ard_hw_vibration.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| ⚡ BLE Proxy | ${{ needs.build_ard_ble_proxy.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| ⚡ Media Player | ${{ needs.build_ard_media_player.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 🌍 Complete (latest) | ${{ needs.build_comprehensive_ard_latest.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 🌍 Complete (dev) | ${{ needs.build_comprehensive_ard_dev.result }} |" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY - if [ "${{ needs.build_comprehensive.result }}" == "skipped" ]; then - TOTAL=$FOUNDATION_BUILDS - echo "**Builds run:** $TOTAL (foundation only)" >> $GITHUB_STEP_SUMMARY - else - TOTAL=$((FOUNDATION_BUILDS + COMPREHENSIVE_BUILDS)) - echo "**Builds run:** $TOTAL ($FOUNDATION_BUILDS foundation + $COMPREHENSIVE_BUILDS comprehensive)" >> $GITHUB_STEP_SUMMARY + # IDF Results + echo "### 🔧 ESP-IDF Framework" >> $GITHUB_STEP_SUMMARY + echo "| Component | Status |" >> $GITHUB_STEP_SUMMARY + echo "|-----------|--------|" >> $GITHUB_STEP_SUMMARY + echo "| 🏗️ Core | ${{ needs.build_idf_core.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 📦 Basic | ${{ needs.build_idf_basic.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 HW Relays | ${{ needs.build_idf_hw_relays.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 HW Speaker | ${{ needs.build_idf_hw_speaker.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 HW Vibration | ${{ needs.build_idf_hw_vibration.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| ⚡ BLE Proxy | ${{ needs.build_idf_ble_proxy.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| ⚡ Media Player | ${{ needs.build_idf_media_player.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 🌍 Complete (latest) | ${{ needs.build_comprehensive_idf_latest.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 🌍 Complete (dev) | ${{ needs.build_comprehensive_idf_dev.result }} |" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + # Overall Status + ARD_FAILED=false + IDF_FAILED=false + + # Check Arduino chain + if [ "${{ needs.build_ard_core.result }}" != "success" ] || \ + [ "${{ needs.build_ard_basic.result }}" != "success" ]; then + ARD_FAILED=true fi - echo "**Efficiency:** $((100 - (TOTAL * 100 / 42)))% fewer builds than full matrix" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY + # Check IDF chain + if [ "${{ needs.build_idf_core.result }}" != "success" ] || \ + [ "${{ needs.build_idf_basic.result }}" != "success" ]; then + IDF_FAILED=true + fi - # Results - echo "| Stage | Result |" >> $GITHUB_STEP_SUMMARY - echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY - echo "| 🏗️ Foundation | ${{ needs.build_core.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 📦 Basic (Most Common) | ${{ needs.build_basic.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 Hardware | ${{ needs.build_hardware.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| ⚡ Features | ${{ needs.build_features.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🌍 Multi-version | ${{ needs.build_comprehensive.result }} |" >> $GITHUB_STEP_SUMMARY - - # Final status - if [ "${{ needs.build_core.result }}" != "success" ]; then - echo "" >> $GITHUB_STEP_SUMMARY - echo "❌ **Core foundation failed** - Fix core components first" >> $GITHUB_STEP_SUMMARY + # Generate final summary + if [ "$ARD_FAILED" == "true" ] && [ "$IDF_FAILED" == "true" ]; then + echo "❌ **Both frameworks failed** - Core issues affecting all builds" >> $GITHUB_STEP_SUMMARY exit 1 - elif [ "${{ needs.build_basic.result }}" != "success" ]; then - echo "" >> $GITHUB_STEP_SUMMARY - echo "❌ **Basic build failed** - Most common configuration has issues" >> $GITHUB_STEP_SUMMARY + elif [ "$ARD_FAILED" == "true" ]; then + echo "⚠️ **Arduino framework failed** - IDF builds may continue independently" >> $GITHUB_STEP_SUMMARY exit 1 - elif [ "${{ needs.build_hardware.result }}" != "success" ]; then - echo "" >> $GITHUB_STEP_SUMMARY - echo "❌ **Hardware builds failed** - Individual components have issues" >> $GITHUB_STEP_SUMMARY - exit 1 - elif [ "${{ needs.build_features.result }}" != "success" ]; then - echo "" >> $GITHUB_STEP_SUMMARY - echo "❌ **Feature builds failed** - Advanced features have issues" >> $GITHUB_STEP_SUMMARY - exit 1 - elif [ "${{ needs.build_comprehensive.result }}" == "failure" ]; then - echo "" >> $GITHUB_STEP_SUMMARY - echo "⚠️ **Multi-version testing failed** - Works on latest, issues with dev" >> $GITHUB_STEP_SUMMARY + elif [ "$IDF_FAILED" == "true" ]; then + echo "⚠️ **ESP-IDF framework failed** - Arduino builds may continue independently" >> $GITHUB_STEP_SUMMARY exit 1 else - echo "" >> $GITHUB_STEP_SUMMARY - echo "✅ **All builds passed!** Ready for production 🚀" >> $GITHUB_STEP_SUMMARY + echo "✅ **All foundation builds passed!** Both frameworks working correctly 🎉" >> $GITHUB_STEP_SUMMARY fi ... From ddfd4b3220d4ec492fde2327298f5660f4751cba Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 15:12:35 +0200 Subject: [PATCH 26/51] Add environment names --- .github/workflows/validate_esphome.yml | 60 +++++++++++++------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index 0e2c8fb..c4331a1 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -52,171 +52,171 @@ jobs: - name: Validate YAML files run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} + - # Arduino Framework - Foundation + # Arduino Framework - Foundation (latest) build_ard_core: - name: "🏗️ Arduino Core" + name: "🏗️ Arduino Core (latest)" needs: code_scan runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build Arduino Core + - name: Build Arduino Core - latest uses: esphome/build-action@main with: yaml-file: ".test/esphome_ard_core.yaml" version: latest build_ard_basic: - name: "📦 Arduino Basic" + name: "📦 Arduino Basic (latest)" needs: build_ard_core runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build Arduino Basic + - name: Build Arduino Basic - latest uses: esphome/build-action@main with: yaml-file: ".test/esphome_ard_basic.yaml" version: latest build_ard_hw_relays: - name: "🔌 Arduino HW Relays" + name: "🔌 Arduino HW Relays (latest)" needs: [build_ard_core, build_ard_basic] runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build Arduino HW Relays + - name: Build Arduino HW Relays - latest uses: esphome/build-action@main with: yaml-file: ".test/esphome_ard_hw_relays.yaml" version: latest build_ard_hw_speaker: - name: "🔌 Arduino HW Speaker" + name: "🔌 Arduino HW Speaker (latest)" needs: [build_ard_core, build_ard_basic] runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build Arduino HW Speaker + - name: Build Arduino HW Speaker - latest uses: esphome/build-action@main with: yaml-file: ".test/esphome_ard_hw_speaker.yaml" version: latest build_ard_hw_vibration: - name: "🔌 Arduino HW Vibration" + name: "🔌 Arduino HW Vibration (latest)" needs: [build_ard_core, build_ard_basic] runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build Arduino HW Vibration + - name: Build Arduino HW Vibration - latest uses: esphome/build-action@main with: yaml-file: ".test/esphome_ard_hw_vibration.yaml" version: latest build_ard_ble_proxy: - name: "⚡ Arduino BLE Proxy" + name: "⚡ Arduino BLE Proxy (latest)" needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration] runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build Arduino BLE Proxy + - name: Build Arduino BLE Proxy - latest uses: esphome/build-action@main with: yaml-file: ".test/esphome_ard_ble_proxy.yaml" version: latest build_ard_media_player: - name: "⚡ Arduino Media Player" + name: "⚡ Arduino Media Player (latest)" needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration] runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build Arduino Media Player + - name: Build Arduino Media Player - latest uses: esphome/build-action@main with: yaml-file: ".test/esphome_ard_media_player.yaml" version: latest - # IDF Framework - Foundation + # IDF Framework - Foundation (latest) build_idf_core: - name: "🏗️ IDF Core" + name: "🏗️ IDF Core (latest)" needs: code_scan runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build IDF Core + - name: Build IDF Core - latest uses: esphome/build-action@main with: yaml-file: ".test/esphome_idf_core.yaml" version: latest build_idf_basic: - name: "📦 IDF Basic" + name: "📦 IDF Basic (latest)" needs: build_idf_core runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build IDF Basic + - name: Build IDF Basic - latest uses: esphome/build-action@main with: yaml-file: ".test/esphome_idf_basic.yaml" version: latest build_idf_hw_relays: - name: "🔌 IDF HW Relays" + name: "🔌 IDF HW Relays (latest)" needs: [build_idf_core, build_idf_basic] runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build IDF HW Relays + - name: Build IDF HW Relays - latest uses: esphome/build-action@main with: yaml-file: ".test/esphome_idf_hw_relays.yaml" version: latest build_idf_hw_speaker: - name: "🔌 IDF HW Speaker" + name: "🔌 IDF HW Speaker (latest)" needs: [build_idf_core, build_idf_basic] runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build IDF HW Speaker + - name: Build IDF HW Speaker - latest uses: esphome/build-action@main with: yaml-file: ".test/esphome_idf_hw_speaker.yaml" version: latest build_idf_hw_vibration: - name: "🔌 IDF HW Vibration" + name: "🔌 IDF HW Vibration (latest)" needs: [build_idf_core, build_idf_basic] runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build IDF HW Vibration + - name: Build IDF HW Vibration - latest uses: esphome/build-action@main with: yaml-file: ".test/esphome_idf_hw_vibration.yaml" version: latest build_idf_ble_proxy: - name: "⚡ IDF BLE Proxy" + name: "⚡ IDF BLE Proxy (latest)" needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration] runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build IDF BLE Proxy + - name: Build IDF BLE Proxy - latest uses: esphome/build-action@main with: yaml-file: ".test/esphome_idf_ble_proxy.yaml" version: latest build_idf_media_player: - name: "⚡ IDF Media Player" + name: "⚡ IDF Media Player (latest)" needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration] runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build IDF Media Player + - name: Build IDF Media Player - latest uses: esphome/build-action@main with: yaml-file: ".test/esphome_idf_media_player.yaml" From bc0b775df2ec94496f2af9bab52adcc4d47a62da Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 15:21:48 +0200 Subject: [PATCH 27/51] A bit more reorg --- .github/workflows/validate_esphome.yml | 182 ++++++++++++++----------- 1 file changed, 100 insertions(+), 82 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index c4331a1..eb13ed8 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -113,7 +113,7 @@ jobs: yaml-file: ".test/esphome_ard_hw_vibration.yaml" version: latest - build_ard_ble_proxy: + build_ard_ble_proxy_latest: name: "⚡ Arduino BLE Proxy (latest)" needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration] runs-on: ubuntu-latest @@ -125,7 +125,20 @@ jobs: yaml-file: ".test/esphome_ard_ble_proxy.yaml" version: latest - build_ard_media_player: + build_ard_ble_proxy_dev: + name: "⚡ Arduino BLE Proxy (dev)" + needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration] + if: success() && !inputs.skip_dev + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Arduino BLE Proxy - dev + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_ble_proxy.yaml" + version: dev + + build_ard_media_player_latest: name: "⚡ Arduino Media Player (latest)" needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration] runs-on: ubuntu-latest @@ -137,6 +150,19 @@ jobs: yaml-file: ".test/esphome_ard_media_player.yaml" version: latest + build_ard_media_player_dev: + name: "⚡ Arduino Media Player (dev)" + needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration] + if: success() && !inputs.skip_dev + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Arduino Media Player - dev + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_media_player.yaml" + version: dev + # IDF Framework - Foundation (latest) build_idf_core: name: "🏗️ IDF Core (latest)" @@ -198,7 +224,7 @@ jobs: yaml-file: ".test/esphome_idf_hw_vibration.yaml" version: latest - build_idf_ble_proxy: + build_idf_ble_proxy_latest: name: "⚡ IDF BLE Proxy (latest)" needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration] runs-on: ubuntu-latest @@ -210,7 +236,20 @@ jobs: yaml-file: ".test/esphome_idf_ble_proxy.yaml" version: latest - build_idf_media_player: + build_idf_ble_proxy_dev: + name: "⚡ IDF BLE Proxy (dev)" + needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration] + if: success() && !inputs.skip_dev + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build IDF BLE Proxy - dev + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_ble_proxy.yaml" + version: dev + + build_idf_media_player_latest: name: "⚡ IDF Media Player (latest)" needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration] runs-on: ubuntu-latest @@ -222,57 +261,17 @@ jobs: yaml-file: ".test/esphome_idf_media_player.yaml" version: latest - # Comprehensive Testing - Multi-version validation - build_comprehensive_ard_latest: - name: "🌍 Arduino Complete (latest)" - needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration, build_ard_ble_proxy, build_ard_media_player] + build_idf_media_player_dev: + name: "⚡ IDF Media Player (dev)" + needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration] if: success() && !inputs.skip_dev runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build Arduino Complete - latest + - name: Build IDF Media Player - dev uses: esphome/build-action@main with: - yaml-file: ".test/esphome_ard_basic.yaml" - version: latest - - build_comprehensive_ard_dev: - name: "🌍 Arduino Complete (dev)" - needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration, build_ard_ble_proxy, build_ard_media_player] - if: success() && !inputs.skip_dev - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Arduino Complete - dev - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_basic.yaml" - version: dev - - build_comprehensive_idf_latest: - name: "🌍 IDF Complete (latest)" - needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration, build_idf_ble_proxy, build_idf_media_player] - if: success() && !inputs.skip_dev - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build IDF Complete - latest - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_basic.yaml" - version: latest - - build_comprehensive_idf_dev: - name: "🌍 IDF Complete (dev)" - needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration, build_idf_ble_proxy, build_idf_media_player] - if: success() && !inputs.skip_dev - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build IDF Complete - dev - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_basic.yaml" + yaml-file: ".test/esphome_idf_media_player.yaml" version: dev # Results summary @@ -284,19 +283,19 @@ jobs: - build_ard_hw_relays - build_ard_hw_speaker - build_ard_hw_vibration - - build_ard_ble_proxy - - build_ard_media_player + - build_ard_ble_proxy_latest + - build_ard_ble_proxy_dev + - build_ard_media_player_latest + - build_ard_media_player_dev - build_idf_core - build_idf_basic - build_idf_hw_relays - build_idf_hw_speaker - build_idf_hw_vibration - - build_idf_ble_proxy - - build_idf_media_player - - build_comprehensive_ard_latest - - build_comprehensive_ard_dev - - build_comprehensive_idf_latest - - build_comprehensive_idf_dev + - build_idf_ble_proxy_latest + - build_idf_ble_proxy_dev + - build_idf_media_player_latest + - build_idf_media_player_dev if: always() runs-on: ubuntu-latest steps: @@ -304,50 +303,61 @@ jobs: run: | echo "## 📋 ESPHome Build Results" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "**Strategy:** Framework-specific dependency chains with independent failure paths" >> $GITHUB_STEP_SUMMARY + echo "**Strategy:** Framework-specific dependency chains with multi-version testing for advanced features" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY # Arduino Results echo "### 🤖 Arduino Framework" >> $GITHUB_STEP_SUMMARY - echo "| Component | Status |" >> $GITHUB_STEP_SUMMARY - echo "|-----------|--------|" >> $GITHUB_STEP_SUMMARY - echo "| 🏗️ Core | ${{ needs.build_ard_core.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 📦 Basic | ${{ needs.build_ard_basic.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 HW Relays | ${{ needs.build_ard_hw_relays.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 HW Speaker | ${{ needs.build_ard_hw_speaker.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 HW Vibration | ${{ needs.build_ard_hw_vibration.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| ⚡ BLE Proxy | ${{ needs.build_ard_ble_proxy.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| ⚡ Media Player | ${{ needs.build_ard_media_player.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🌍 Complete (latest) | ${{ needs.build_comprehensive_ard_latest.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🌍 Complete (dev) | ${{ needs.build_comprehensive_ard_dev.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| Component | Latest | Dev |" >> $GITHUB_STEP_SUMMARY + echo "|-----------|--------|-----|" >> $GITHUB_STEP_SUMMARY + echo "| 🏗️ Core | ${{ needs.build_ard_core.result }} | - |" >> $GITHUB_STEP_SUMMARY + echo "| 📦 Basic | ${{ needs.build_ard_basic.result }} | - |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 HW Relays | ${{ needs.build_ard_hw_relays.result }} | - |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 HW Speaker | ${{ needs.build_ard_hw_speaker.result }} | - |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 HW Vibration | ${{ needs.build_ard_hw_vibration.result }} | - |" >> $GITHUB_STEP_SUMMARY + echo "| ⚡ BLE Proxy | ${{ needs.build_ard_ble_proxy_latest.result }} | ${{ needs.build_ard_ble_proxy_dev.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| ⚡ Media Player | ${{ needs.build_ard_media_player_latest.result }} | ${{ needs.build_ard_media_player_dev.result }} |" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY # IDF Results echo "### 🔧 ESP-IDF Framework" >> $GITHUB_STEP_SUMMARY - echo "| Component | Status |" >> $GITHUB_STEP_SUMMARY - echo "|-----------|--------|" >> $GITHUB_STEP_SUMMARY - echo "| 🏗️ Core | ${{ needs.build_idf_core.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 📦 Basic | ${{ needs.build_idf_basic.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 HW Relays | ${{ needs.build_idf_hw_relays.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 HW Speaker | ${{ needs.build_idf_hw_speaker.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 HW Vibration | ${{ needs.build_idf_hw_vibration.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| ⚡ BLE Proxy | ${{ needs.build_idf_ble_proxy.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| ⚡ Media Player | ${{ needs.build_idf_media_player.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🌍 Complete (latest) | ${{ needs.build_comprehensive_idf_latest.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🌍 Complete (dev) | ${{ needs.build_comprehensive_idf_dev.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| Component | Latest | Dev |" >> $GITHUB_STEP_SUMMARY + echo "|-----------|--------|-----|" >> $GITHUB_STEP_SUMMARY + echo "| 🏗️ Core | ${{ needs.build_idf_core.result }} | - |" >> $GITHUB_STEP_SUMMARY + echo "| 📦 Basic | ${{ needs.build_idf_basic.result }} | - |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 HW Relays | ${{ needs.build_idf_hw_relays.result }} | - |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 HW Speaker | ${{ needs.build_idf_hw_speaker.result }} | - |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 HW Vibration | ${{ needs.build_idf_hw_vibration.result }} | - |" >> $GITHUB_STEP_SUMMARY + echo "| ⚡ BLE Proxy | ${{ needs.build_idf_ble_proxy_latest.result }} | ${{ needs.build_idf_ble_proxy_dev.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| ⚡ Media Player | ${{ needs.build_idf_media_player_latest.result }} | ${{ needs.build_idf_media_player_dev.result }} |" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + # Build counts + FOUNDATION_BUILDS=14 # 2+2+6+4 (core+basic+hw+features latest only) + ADDITIONAL_BUILDS=4 # BLE Proxy + Media Player on dev (if not skipped) + + if [ "${{ inputs.skip_dev }}" == "true" ]; then + TOTAL=$FOUNDATION_BUILDS + echo "**Total builds:** $TOTAL (dev testing skipped)" >> $GITHUB_STEP_SUMMARY + else + TOTAL=$((FOUNDATION_BUILDS + ADDITIONAL_BUILDS)) + echo "**Total builds:** $TOTAL ($FOUNDATION_BUILDS foundation + $ADDITIONAL_BUILDS dev testing)" >> $GITHUB_STEP_SUMMARY + fi + + echo "**Efficiency:** $((100 - (TOTAL * 100 / 42)))% fewer builds than full matrix" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY # Overall Status ARD_FAILED=false IDF_FAILED=false - # Check Arduino chain + # Check Arduino chain (foundation components must pass) if [ "${{ needs.build_ard_core.result }}" != "success" ] || \ [ "${{ needs.build_ard_basic.result }}" != "success" ]; then ARD_FAILED=true fi - # Check IDF chain + # Check IDF chain (foundation components must pass) if [ "${{ needs.build_idf_core.result }}" != "success" ] || \ [ "${{ needs.build_idf_basic.result }}" != "success" ]; then IDF_FAILED=true @@ -365,5 +375,13 @@ jobs: exit 1 else echo "✅ **All foundation builds passed!** Both frameworks working correctly 🎉" >> $GITHUB_STEP_SUMMARY + + # Check advanced features + if [ "${{ needs.build_ard_ble_proxy_dev.result }}" == "failure" ] || \ + [ "${{ needs.build_ard_media_player_dev.result }}" == "failure" ] || \ + [ "${{ needs.build_idf_ble_proxy_dev.result }}" == "failure" ] || \ + [ "${{ needs.build_idf_media_player_dev.result }}" == "failure" ]; then + echo "⚠️ **Some dev builds failed** - Advanced features may have compatibility issues with dev ESPHome" >> $GITHUB_STEP_SUMMARY + fi fi ... From efd4eaa6bb130973f154d69815023c771733c840 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 15:26:04 +0200 Subject: [PATCH 28/51] Detailed summary --- .github/workflows/validate_esphome.yml | 144 +++++++++++++------------ 1 file changed, 78 insertions(+), 66 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index eb13ed8..e3dbb94 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -303,85 +303,97 @@ jobs: run: | echo "## 📋 ESPHome Build Results" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "**Strategy:** Framework-specific dependency chains with multi-version testing for advanced features" >> $GITHUB_STEP_SUMMARY + + # Build Matrix Summary + echo "### 🏗️ Foundation Components (Latest Only)" >> $GITHUB_STEP_SUMMARY + echo "| Component | 🤖 Arduino | 🔧 ESP-IDF |" >> $GITHUB_STEP_SUMMARY + echo "|-----------|-------------|------------|" >> $GITHUB_STEP_SUMMARY + echo "| 🏗️ Core | ${{ needs.build_ard_core.result }} | ${{ needs.build_idf_core.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 📦 Basic | ${{ needs.build_ard_basic.result }} | ${{ needs.build_idf_basic.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 HW Relays | ${{ needs.build_ard_hw_relays.result }} | ${{ needs.build_idf_hw_relays.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 HW Speaker | ${{ needs.build_ard_hw_speaker.result }} | ${{ needs.build_idf_hw_speaker.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| 🔌 HW Vibration | ${{ needs.build_ard_hw_vibration.result }} | ${{ needs.build_idf_hw_vibration.result }} |" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - # Arduino Results - echo "### 🤖 Arduino Framework" >> $GITHUB_STEP_SUMMARY - echo "| Component | Latest | Dev |" >> $GITHUB_STEP_SUMMARY - echo "|-----------|--------|-----|" >> $GITHUB_STEP_SUMMARY - echo "| 🏗️ Core | ${{ needs.build_ard_core.result }} | - |" >> $GITHUB_STEP_SUMMARY - echo "| 📦 Basic | ${{ needs.build_ard_basic.result }} | - |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 HW Relays | ${{ needs.build_ard_hw_relays.result }} | - |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 HW Speaker | ${{ needs.build_ard_hw_speaker.result }} | - |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 HW Vibration | ${{ needs.build_ard_hw_vibration.result }} | - |" >> $GITHUB_STEP_SUMMARY - echo "| ⚡ BLE Proxy | ${{ needs.build_ard_ble_proxy_latest.result }} | ${{ needs.build_ard_ble_proxy_dev.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| ⚡ Media Player | ${{ needs.build_ard_media_player_latest.result }} | ${{ needs.build_ard_media_player_dev.result }} |" >> $GITHUB_STEP_SUMMARY + echo "### ⚡ Advanced Features (Multi-Version)" >> $GITHUB_STEP_SUMMARY + echo "| Component | 🤖 Arduino Latest | 🤖 Arduino Dev | 🔧 IDF Latest | 🔧 IDF Dev |" >> $GITHUB_STEP_SUMMARY + echo "|-----------|-------------------|----------------|---------------|------------|" >> $GITHUB_STEP_SUMMARY + echo "| ⚡ BLE Proxy | ${{ needs.build_ard_ble_proxy_latest.result }} | ${{ needs.build_ard_ble_proxy_dev.result }} | ${{ needs.build_idf_ble_proxy_latest.result }} | ${{ needs.build_idf_ble_proxy_dev.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| ⚡ Media Player | ${{ needs.build_ard_media_player_latest.result }} | ${{ needs.build_ard_media_player_dev.result }} | ${{ needs.build_idf_media_player_latest.result }} | ${{ needs.build_idf_media_player_dev.result }} |" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - # IDF Results - echo "### 🔧 ESP-IDF Framework" >> $GITHUB_STEP_SUMMARY - echo "| Component | Latest | Dev |" >> $GITHUB_STEP_SUMMARY - echo "|-----------|--------|-----|" >> $GITHUB_STEP_SUMMARY - echo "| 🏗️ Core | ${{ needs.build_idf_core.result }} | - |" >> $GITHUB_STEP_SUMMARY - echo "| 📦 Basic | ${{ needs.build_idf_basic.result }} | - |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 HW Relays | ${{ needs.build_idf_hw_relays.result }} | - |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 HW Speaker | ${{ needs.build_idf_hw_speaker.result }} | - |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 HW Vibration | ${{ needs.build_idf_hw_vibration.result }} | - |" >> $GITHUB_STEP_SUMMARY - echo "| ⚡ BLE Proxy | ${{ needs.build_idf_ble_proxy_latest.result }} | ${{ needs.build_idf_ble_proxy_dev.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| ⚡ Media Player | ${{ needs.build_idf_media_player_latest.result }} | ${{ needs.build_idf_media_player_dev.result }} |" >> $GITHUB_STEP_SUMMARY + # Environment Summary + echo "### 🌍 Environment Summary" >> $GITHUB_STEP_SUMMARY + + # Count successes per environment + ARD_LATEST_SUCCESS=0 + ARD_DEV_SUCCESS=0 + IDF_LATEST_SUCCESS=0 + IDF_DEV_SUCCESS=0 + + # Arduino Latest (7 builds) + [ "${{ needs.build_ard_core.result }}" == "success" ] && ARD_LATEST_SUCCESS=$((ARD_LATEST_SUCCESS + 1)) + [ "${{ needs.build_ard_basic.result }}" == "success" ] && ARD_LATEST_SUCCESS=$((ARD_LATEST_SUCCESS + 1)) + [ "${{ needs.build_ard_hw_relays.result }}" == "success" ] && ARD_LATEST_SUCCESS=$((ARD_LATEST_SUCCESS + 1)) + [ "${{ needs.build_ard_hw_speaker.result }}" == "success" ] && ARD_LATEST_SUCCESS=$((ARD_LATEST_SUCCESS + 1)) + [ "${{ needs.build_ard_hw_vibration.result }}" == "success" ] && ARD_LATEST_SUCCESS=$((ARD_LATEST_SUCCESS + 1)) + [ "${{ needs.build_ard_ble_proxy_latest.result }}" == "success" ] && ARD_LATEST_SUCCESS=$((ARD_LATEST_SUCCESS + 1)) + [ "${{ needs.build_ard_media_player_latest.result }}" == "success" ] && ARD_LATEST_SUCCESS=$((ARD_LATEST_SUCCESS + 1)) + + # Arduino Dev (2 builds if not skipped) + if [ "${{ inputs.skip_dev }}" != "true" ]; then + [ "${{ needs.build_ard_ble_proxy_dev.result }}" == "success" ] && ARD_DEV_SUCCESS=$((ARD_DEV_SUCCESS + 1)) + [ "${{ needs.build_ard_media_player_dev.result }}" == "success" ] && ARD_DEV_SUCCESS=$((ARD_DEV_SUCCESS + 1)) + fi + + # IDF Latest (7 builds) + [ "${{ needs.build_idf_core.result }}" == "success" ] && IDF_LATEST_SUCCESS=$((IDF_LATEST_SUCCESS + 1)) + [ "${{ needs.build_idf_basic.result }}" == "success" ] && IDF_LATEST_SUCCESS=$((IDF_LATEST_SUCCESS + 1)) + [ "${{ needs.build_idf_hw_relays.result }}" == "success" ] && IDF_LATEST_SUCCESS=$((IDF_LATEST_SUCCESS + 1)) + [ "${{ needs.build_idf_hw_speaker.result }}" == "success" ] && IDF_LATEST_SUCCESS=$((IDF_LATEST_SUCCESS + 1)) + [ "${{ needs.build_idf_hw_vibration.result }}" == "success" ] && IDF_LATEST_SUCCESS=$((IDF_LATEST_SUCCESS + 1)) + [ "${{ needs.build_idf_ble_proxy_latest.result }}" == "success" ] && IDF_LATEST_SUCCESS=$((IDF_LATEST_SUCCESS + 1)) + [ "${{ needs.build_idf_media_player_latest.result }}" == "success" ] && IDF_LATEST_SUCCESS=$((IDF_LATEST_SUCCESS + 1)) + + # IDF Dev (2 builds if not skipped) + if [ "${{ inputs.skip_dev }}" != "true" ]; then + [ "${{ needs.build_idf_ble_proxy_dev.result }}" == "success" ] && IDF_DEV_SUCCESS=$((IDF_DEV_SUCCESS + 1)) + [ "${{ needs.build_idf_media_player_dev.result }}" == "success" ] && IDF_DEV_SUCCESS=$((IDF_DEV_SUCCESS + 1)) + fi + + echo "| Framework | Latest ESPHome | Dev ESPHome |" >> $GITHUB_STEP_SUMMARY + echo "|-----------|----------------|-------------|" >> $GITHUB_STEP_SUMMARY + echo "| 🤖 **Arduino** | ✅ $ARD_LATEST_SUCCESS/7 | ✅ $ARD_DEV_SUCCESS/2 |" >> $GITHUB_STEP_SUMMARY + echo "| 🔧 **ESP-IDF** | ✅ $IDF_LATEST_SUCCESS/7 | ✅ $IDF_DEV_SUCCESS/2 |" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - # Build counts - FOUNDATION_BUILDS=14 # 2+2+6+4 (core+basic+hw+features latest only) - ADDITIONAL_BUILDS=4 # BLE Proxy + Media Player on dev (if not skipped) + # Framework Summary + echo "### 🎯 Framework Summary" >> $GITHUB_STEP_SUMMARY + ARD_TOTAL=$((ARD_LATEST_SUCCESS + ARD_DEV_SUCCESS)) + IDF_TOTAL=$((IDF_LATEST_SUCCESS + IDF_DEV_SUCCESS)) if [ "${{ inputs.skip_dev }}" == "true" ]; then - TOTAL=$FOUNDATION_BUILDS - echo "**Total builds:** $TOTAL (dev testing skipped)" >> $GITHUB_STEP_SUMMARY + ARD_MAX=7 + IDF_MAX=7 + TOTAL_MAX=14 else - TOTAL=$((FOUNDATION_BUILDS + ADDITIONAL_BUILDS)) - echo "**Total builds:** $TOTAL ($FOUNDATION_BUILDS foundation + $ADDITIONAL_BUILDS dev testing)" >> $GITHUB_STEP_SUMMARY + ARD_MAX=9 + IDF_MAX=9 + TOTAL_MAX=18 fi - echo "**Efficiency:** $((100 - (TOTAL * 100 / 42)))% fewer builds than full matrix" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY + GRAND_TOTAL=$((ARD_TOTAL + IDF_TOTAL)) - # Overall Status - ARD_FAILED=false - IDF_FAILED=false + echo "- 🤖 **Arduino**: $ARD_TOTAL/$ARD_MAX builds passed" >> $GITHUB_STEP_SUMMARY + echo "- 🔧 **ESP-IDF**: $IDF_TOTAL/$IDF_MAX builds passed" >> $GITHUB_STEP_SUMMARY + echo "- 🎯 **Overall**: $GRAND_TOTAL/$TOTAL_MAX builds passed" >> $GITHUB_STEP_SUMMARY - # Check Arduino chain (foundation components must pass) - if [ "${{ needs.build_ard_core.result }}" != "success" ] || \ - [ "${{ needs.build_ard_basic.result }}" != "success" ]; then - ARD_FAILED=true - fi - - # Check IDF chain (foundation components must pass) - if [ "${{ needs.build_idf_core.result }}" != "success" ] || \ - [ "${{ needs.build_idf_basic.result }}" != "success" ]; then - IDF_FAILED=true - fi - - # Generate final summary - if [ "$ARD_FAILED" == "true" ] && [ "$IDF_FAILED" == "true" ]; then - echo "❌ **Both frameworks failed** - Core issues affecting all builds" >> $GITHUB_STEP_SUMMARY - exit 1 - elif [ "$ARD_FAILED" == "true" ]; then - echo "⚠️ **Arduino framework failed** - IDF builds may continue independently" >> $GITHUB_STEP_SUMMARY - exit 1 - elif [ "$IDF_FAILED" == "true" ]; then - echo "⚠️ **ESP-IDF framework failed** - Arduino builds may continue independently" >> $GITHUB_STEP_SUMMARY - exit 1 + # Final status emoji + if [ "$GRAND_TOTAL" -eq "$TOTAL_MAX" ]; then + echo "- 🎉 **Status**: All builds successful!" >> $GITHUB_STEP_SUMMARY + elif [ "$GRAND_TOTAL" -gt "$((TOTAL_MAX * 3 / 4))" ]; then + echo "- ⚠️ **Status**: Most builds successful, some issues detected" >> $GITHUB_STEP_SUMMARY else - echo "✅ **All foundation builds passed!** Both frameworks working correctly 🎉" >> $GITHUB_STEP_SUMMARY - - # Check advanced features - if [ "${{ needs.build_ard_ble_proxy_dev.result }}" == "failure" ] || \ - [ "${{ needs.build_ard_media_player_dev.result }}" == "failure" ] || \ - [ "${{ needs.build_idf_ble_proxy_dev.result }}" == "failure" ] || \ - [ "${{ needs.build_idf_media_player_dev.result }}" == "failure" ]; then - echo "⚠️ **Some dev builds failed** - Advanced features may have compatibility issues with dev ESPHome" >> $GITHUB_STEP_SUMMARY - fi + echo "- ❌ **Status**: Multiple build failures detected" >> $GITHUB_STEP_SUMMARY fi ... From 5b77f44ae294c467615ec55d975b3c97bdeb9a4c Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 15:33:54 +0200 Subject: [PATCH 29/51] Lint --- .github/workflows/validate_esphome.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index e3dbb94..5e415ff 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -318,8 +318,14 @@ jobs: echo "### ⚡ Advanced Features (Multi-Version)" >> $GITHUB_STEP_SUMMARY echo "| Component | 🤖 Arduino Latest | 🤖 Arduino Dev | 🔧 IDF Latest | 🔧 IDF Dev |" >> $GITHUB_STEP_SUMMARY echo "|-----------|-------------------|----------------|---------------|------------|" >> $GITHUB_STEP_SUMMARY - echo "| ⚡ BLE Proxy | ${{ needs.build_ard_ble_proxy_latest.result }} | ${{ needs.build_ard_ble_proxy_dev.result }} | ${{ needs.build_idf_ble_proxy_latest.result }} | ${{ needs.build_idf_ble_proxy_dev.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| ⚡ Media Player | ${{ needs.build_ard_media_player_latest.result }} | ${{ needs.build_ard_media_player_dev.result }} | ${{ needs.build_idf_media_player_latest.result }} | ${{ needs.build_idf_media_player_dev.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| ⚡ BLE Proxy | ${{ needs.build_ard_ble_proxy_latest.result }} | \ + ${{ needs.build_ard_ble_proxy_dev.result }} | \ + ${{ needs.build_idf_ble_proxy_latest.result }} | \ + ${{ needs.build_idf_ble_proxy_dev.result }} |" >> $GITHUB_STEP_SUMMARY + echo "| ⚡ Media Player | ${{ needs.build_ard_media_player_latest.result }} | \ + ${{ needs.build_ard_media_player_dev.result }} | \ + ${{ needs.build_idf_media_player_latest.result }} | \ + ${{ needs.build_idf_media_player_dev.result }} |" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY # Environment Summary From 4707506c748f5b6251696ce7b5070c2567edf519 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 15:40:49 +0200 Subject: [PATCH 30/51] Fix grouping --- .github/workflows/validate_esphome.yml | 238 +++++++++++++------------ 1 file changed, 125 insertions(+), 113 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index 5e415ff..ffb9f99 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -274,132 +274,144 @@ jobs: yaml-file: ".test/esphome_idf_media_player.yaml" version: dev - # Results summary - build_summary: - name: "📊 Build Summary" - needs: - - build_ard_core - - build_ard_basic - - build_ard_hw_relays - - build_ard_hw_speaker - - build_ard_hw_vibration - - build_ard_ble_proxy_latest - - build_ard_ble_proxy_dev - - build_ard_media_player_latest - - build_ard_media_player_dev - - build_idf_core - - build_idf_basic - - build_idf_hw_relays - - build_idf_hw_speaker - - build_idf_hw_vibration - - build_idf_ble_proxy_latest - - build_idf_ble_proxy_dev - - build_idf_media_player_latest - - build_idf_media_player_dev + # Summary Jobs - Grouped by framework and environment + summary_arduino: + name: "📊 Arduino Framework" + needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration, build_ard_ble_proxy_latest, build_ard_ble_proxy_dev, build_ard_media_player_latest, build_ard_media_player_dev] if: always() runs-on: ubuntu-latest steps: - - name: Generate Results Summary + - name: Arduino Framework Results run: | - echo "## 📋 ESPHome Build Results" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - - # Build Matrix Summary - echo "### 🏗️ Foundation Components (Latest Only)" >> $GITHUB_STEP_SUMMARY - echo "| Component | 🤖 Arduino | 🔧 ESP-IDF |" >> $GITHUB_STEP_SUMMARY - echo "|-----------|-------------|------------|" >> $GITHUB_STEP_SUMMARY - echo "| 🏗️ Core | ${{ needs.build_ard_core.result }} | ${{ needs.build_idf_core.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 📦 Basic | ${{ needs.build_ard_basic.result }} | ${{ needs.build_idf_basic.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 HW Relays | ${{ needs.build_ard_hw_relays.result }} | ${{ needs.build_idf_hw_relays.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 HW Speaker | ${{ needs.build_ard_hw_speaker.result }} | ${{ needs.build_idf_hw_speaker.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| 🔌 HW Vibration | ${{ needs.build_ard_hw_vibration.result }} | ${{ needs.build_idf_hw_vibration.result }} |" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - - echo "### ⚡ Advanced Features (Multi-Version)" >> $GITHUB_STEP_SUMMARY - echo "| Component | 🤖 Arduino Latest | 🤖 Arduino Dev | 🔧 IDF Latest | 🔧 IDF Dev |" >> $GITHUB_STEP_SUMMARY - echo "|-----------|-------------------|----------------|---------------|------------|" >> $GITHUB_STEP_SUMMARY - echo "| ⚡ BLE Proxy | ${{ needs.build_ard_ble_proxy_latest.result }} | \ - ${{ needs.build_ard_ble_proxy_dev.result }} | \ - ${{ needs.build_idf_ble_proxy_latest.result }} | \ - ${{ needs.build_idf_ble_proxy_dev.result }} |" >> $GITHUB_STEP_SUMMARY - echo "| ⚡ Media Player | ${{ needs.build_ard_media_player_latest.result }} | \ - ${{ needs.build_ard_media_player_dev.result }} | \ - ${{ needs.build_idf_media_player_latest.result }} | \ - ${{ needs.build_idf_media_player_dev.result }} |" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - - # Environment Summary - echo "### 🌍 Environment Summary" >> $GITHUB_STEP_SUMMARY - - # Count successes per environment - ARD_LATEST_SUCCESS=0 - ARD_DEV_SUCCESS=0 - IDF_LATEST_SUCCESS=0 - IDF_DEV_SUCCESS=0 - - # Arduino Latest (7 builds) - [ "${{ needs.build_ard_core.result }}" == "success" ] && ARD_LATEST_SUCCESS=$((ARD_LATEST_SUCCESS + 1)) - [ "${{ needs.build_ard_basic.result }}" == "success" ] && ARD_LATEST_SUCCESS=$((ARD_LATEST_SUCCESS + 1)) - [ "${{ needs.build_ard_hw_relays.result }}" == "success" ] && ARD_LATEST_SUCCESS=$((ARD_LATEST_SUCCESS + 1)) - [ "${{ needs.build_ard_hw_speaker.result }}" == "success" ] && ARD_LATEST_SUCCESS=$((ARD_LATEST_SUCCESS + 1)) - [ "${{ needs.build_ard_hw_vibration.result }}" == "success" ] && ARD_LATEST_SUCCESS=$((ARD_LATEST_SUCCESS + 1)) - [ "${{ needs.build_ard_ble_proxy_latest.result }}" == "success" ] && ARD_LATEST_SUCCESS=$((ARD_LATEST_SUCCESS + 1)) - [ "${{ needs.build_ard_media_player_latest.result }}" == "success" ] && ARD_LATEST_SUCCESS=$((ARD_LATEST_SUCCESS + 1)) - - # Arduino Dev (2 builds if not skipped) + SUCCESS=0 + TOTAL=0 + + # Count latest builds (always run) + [ "${{ needs.build_ard_core.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_ard_basic.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_ard_hw_relays.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_ard_hw_speaker.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_ard_hw_vibration.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_ard_ble_proxy_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_ard_media_player_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + TOTAL=$((TOTAL + 7)) + + # Count dev builds (if not skipped) if [ "${{ inputs.skip_dev }}" != "true" ]; then - [ "${{ needs.build_ard_ble_proxy_dev.result }}" == "success" ] && ARD_DEV_SUCCESS=$((ARD_DEV_SUCCESS + 1)) - [ "${{ needs.build_ard_media_player_dev.result }}" == "success" ] && ARD_DEV_SUCCESS=$((ARD_DEV_SUCCESS + 1)) + [ "${{ needs.build_ard_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_ard_media_player_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + TOTAL=$((TOTAL + 2)) + fi + + echo "🤖 Arduino Framework: $SUCCESS/$TOTAL builds passed" + + if [ "$SUCCESS" -eq "$TOTAL" ]; then + echo "✅ All Arduino builds successful!" + else + echo "❌ Some Arduino builds failed" + exit 1 fi - # IDF Latest (7 builds) - [ "${{ needs.build_idf_core.result }}" == "success" ] && IDF_LATEST_SUCCESS=$((IDF_LATEST_SUCCESS + 1)) - [ "${{ needs.build_idf_basic.result }}" == "success" ] && IDF_LATEST_SUCCESS=$((IDF_LATEST_SUCCESS + 1)) - [ "${{ needs.build_idf_hw_relays.result }}" == "success" ] && IDF_LATEST_SUCCESS=$((IDF_LATEST_SUCCESS + 1)) - [ "${{ needs.build_idf_hw_speaker.result }}" == "success" ] && IDF_LATEST_SUCCESS=$((IDF_LATEST_SUCCESS + 1)) - [ "${{ needs.build_idf_hw_vibration.result }}" == "success" ] && IDF_LATEST_SUCCESS=$((IDF_LATEST_SUCCESS + 1)) - [ "${{ needs.build_idf_ble_proxy_latest.result }}" == "success" ] && IDF_LATEST_SUCCESS=$((IDF_LATEST_SUCCESS + 1)) - [ "${{ needs.build_idf_media_player_latest.result }}" == "success" ] && IDF_LATEST_SUCCESS=$((IDF_LATEST_SUCCESS + 1)) - - # IDF Dev (2 builds if not skipped) + summary_idf: + name: "📊 ESP-IDF Framework" + needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration, build_idf_ble_proxy_latest, build_idf_ble_proxy_dev, build_idf_media_player_latest, build_idf_media_player_dev] + if: always() + runs-on: ubuntu-latest + steps: + - name: ESP-IDF Framework Results + run: | + SUCCESS=0 + TOTAL=0 + + # Count latest builds (always run) + [ "${{ needs.build_idf_core.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_idf_basic.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_idf_hw_relays.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_idf_hw_speaker.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_idf_hw_vibration.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_idf_ble_proxy_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_idf_media_player_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + TOTAL=$((TOTAL + 7)) + + # Count dev builds (if not skipped) if [ "${{ inputs.skip_dev }}" != "true" ]; then - [ "${{ needs.build_idf_ble_proxy_dev.result }}" == "success" ] && IDF_DEV_SUCCESS=$((IDF_DEV_SUCCESS + 1)) - [ "${{ needs.build_idf_media_player_dev.result }}" == "success" ] && IDF_DEV_SUCCESS=$((IDF_DEV_SUCCESS + 1)) + [ "${{ needs.build_idf_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_idf_media_player_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + TOTAL=$((TOTAL + 2)) + fi + + echo "🔧 ESP-IDF Framework: $SUCCESS/$TOTAL builds passed" + + if [ "$SUCCESS" -eq "$TOTAL" ]; then + echo "✅ All ESP-IDF builds successful!" + else + echo "❌ Some ESP-IDF builds failed" + exit 1 fi - echo "| Framework | Latest ESPHome | Dev ESPHome |" >> $GITHUB_STEP_SUMMARY - echo "|-----------|----------------|-------------|" >> $GITHUB_STEP_SUMMARY - echo "| 🤖 **Arduino** | ✅ $ARD_LATEST_SUCCESS/7 | ✅ $ARD_DEV_SUCCESS/2 |" >> $GITHUB_STEP_SUMMARY - echo "| 🔧 **ESP-IDF** | ✅ $IDF_LATEST_SUCCESS/7 | ✅ $IDF_DEV_SUCCESS/2 |" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - - # Framework Summary - echo "### 🎯 Framework Summary" >> $GITHUB_STEP_SUMMARY - ARD_TOTAL=$((ARD_LATEST_SUCCESS + ARD_DEV_SUCCESS)) - IDF_TOTAL=$((IDF_LATEST_SUCCESS + IDF_DEV_SUCCESS)) - - if [ "${{ inputs.skip_dev }}" == "true" ]; then - ARD_MAX=7 - IDF_MAX=7 - TOTAL_MAX=14 + summary_latest: + name: "📊 ESPHome (Latest)" + needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration, build_ard_ble_proxy_latest, build_ard_media_player_latest, build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration, build_idf_ble_proxy_latest, build_idf_media_player_latest] + if: always() + runs-on: ubuntu-latest + steps: + - name: Latest ESPHome Results + run: | + SUCCESS=0 + TOTAL=14 + + # Arduino Latest builds + [ "${{ needs.build_ard_core.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_ard_basic.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_ard_hw_relays.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_ard_hw_speaker.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_ard_hw_vibration.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_ard_ble_proxy_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_ard_media_player_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + + # ESP-IDF Latest builds + [ "${{ needs.build_idf_core.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_idf_basic.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_idf_hw_relays.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_idf_hw_speaker.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_idf_hw_vibration.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_idf_ble_proxy_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_idf_media_player_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + + echo "📋 Latest ESPHome: $SUCCESS/$TOTAL builds passed" + + if [ "$SUCCESS" -eq "$TOTAL" ]; then + echo "✅ All builds on latest ESPHome successful!" else - ARD_MAX=9 - IDF_MAX=9 - TOTAL_MAX=18 + echo "❌ Some builds on latest ESPHome failed" + exit 1 fi - GRAND_TOTAL=$((ARD_TOTAL + IDF_TOTAL)) - - echo "- 🤖 **Arduino**: $ARD_TOTAL/$ARD_MAX builds passed" >> $GITHUB_STEP_SUMMARY - echo "- 🔧 **ESP-IDF**: $IDF_TOTAL/$IDF_MAX builds passed" >> $GITHUB_STEP_SUMMARY - echo "- 🎯 **Overall**: $GRAND_TOTAL/$TOTAL_MAX builds passed" >> $GITHUB_STEP_SUMMARY - - # Final status emoji - if [ "$GRAND_TOTAL" -eq "$TOTAL_MAX" ]; then - echo "- 🎉 **Status**: All builds successful!" >> $GITHUB_STEP_SUMMARY - elif [ "$GRAND_TOTAL" -gt "$((TOTAL_MAX * 3 / 4))" ]; then - echo "- ⚠️ **Status**: Most builds successful, some issues detected" >> $GITHUB_STEP_SUMMARY + summary_dev: + name: "📊 ESPHome (Dev)" + needs: [build_ard_ble_proxy_dev, build_ard_media_player_dev, build_idf_ble_proxy_dev, build_idf_media_player_dev] + if: always() && !inputs.skip_dev + runs-on: ubuntu-latest + steps: + - name: Dev ESPHome Results + run: | + SUCCESS=0 + TOTAL=4 + + # Arduino Dev builds + [ "${{ needs.build_ard_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_ard_media_player_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + + # ESP-IDF Dev builds + [ "${{ needs.build_idf_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + [ "${{ needs.build_idf_media_player_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) + + echo "🚀 Dev ESPHome: $SUCCESS/$TOTAL builds passed" + + if [ "$SUCCESS" -eq "$TOTAL" ]; then + echo "✅ All builds on dev ESPHome successful!" else - echo "- ❌ **Status**: Multiple build failures detected" >> $GITHUB_STEP_SUMMARY + echo "❌ Some builds on dev ESPHome failed" + exit 1 fi ... From 9663f295d5d2e52e66f71726beb68302f24b70fe Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 15:44:22 +0200 Subject: [PATCH 31/51] Lint --- .github/workflows/validate_esphome.yml | 52 +++++++++++++++----------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index ffb9f99..d5cc50e 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -277,7 +277,9 @@ jobs: # Summary Jobs - Grouped by framework and environment summary_arduino: name: "📊 Arduino Framework" - needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration, build_ard_ble_proxy_latest, build_ard_ble_proxy_dev, build_ard_media_player_latest, build_ard_media_player_dev] + needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, + build_ard_hw_vibration, build_ard_ble_proxy_latest, build_ard_ble_proxy_dev, + build_ard_media_player_latest, build_ard_media_player_dev] if: always() runs-on: ubuntu-latest steps: @@ -285,7 +287,7 @@ jobs: run: | SUCCESS=0 TOTAL=0 - + # Count latest builds (always run) [ "${{ needs.build_ard_core.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_basic.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) @@ -295,16 +297,16 @@ jobs: [ "${{ needs.build_ard_ble_proxy_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_media_player_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) TOTAL=$((TOTAL + 7)) - + # Count dev builds (if not skipped) if [ "${{ inputs.skip_dev }}" != "true" ]; then [ "${{ needs.build_ard_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_media_player_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) TOTAL=$((TOTAL + 2)) fi - + echo "🤖 Arduino Framework: $SUCCESS/$TOTAL builds passed" - + if [ "$SUCCESS" -eq "$TOTAL" ]; then echo "✅ All Arduino builds successful!" else @@ -314,7 +316,9 @@ jobs: summary_idf: name: "📊 ESP-IDF Framework" - needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration, build_idf_ble_proxy_latest, build_idf_ble_proxy_dev, build_idf_media_player_latest, build_idf_media_player_dev] + needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, + build_idf_hw_vibration, build_idf_ble_proxy_latest, build_idf_ble_proxy_dev, + build_idf_media_player_latest, build_idf_media_player_dev] if: always() runs-on: ubuntu-latest steps: @@ -322,7 +326,7 @@ jobs: run: | SUCCESS=0 TOTAL=0 - + # Count latest builds (always run) [ "${{ needs.build_idf_core.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_basic.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) @@ -332,16 +336,16 @@ jobs: [ "${{ needs.build_idf_ble_proxy_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_media_player_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) TOTAL=$((TOTAL + 7)) - + # Count dev builds (if not skipped) if [ "${{ inputs.skip_dev }}" != "true" ]; then [ "${{ needs.build_idf_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_media_player_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) TOTAL=$((TOTAL + 2)) fi - + echo "🔧 ESP-IDF Framework: $SUCCESS/$TOTAL builds passed" - + if [ "$SUCCESS" -eq "$TOTAL" ]; then echo "✅ All ESP-IDF builds successful!" else @@ -351,7 +355,10 @@ jobs: summary_latest: name: "📊 ESPHome (Latest)" - needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration, build_ard_ble_proxy_latest, build_ard_media_player_latest, build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration, build_idf_ble_proxy_latest, build_idf_media_player_latest] + needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, + build_ard_hw_vibration, build_ard_ble_proxy_latest, build_ard_media_player_latest, + build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, + build_idf_hw_vibration, build_idf_ble_proxy_latest, build_idf_media_player_latest] if: always() runs-on: ubuntu-latest steps: @@ -359,7 +366,7 @@ jobs: run: | SUCCESS=0 TOTAL=14 - + # Arduino Latest builds [ "${{ needs.build_ard_core.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_basic.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) @@ -368,7 +375,7 @@ jobs: [ "${{ needs.build_ard_hw_vibration.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_ble_proxy_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_media_player_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - + # ESP-IDF Latest builds [ "${{ needs.build_idf_core.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_basic.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) @@ -377,9 +384,9 @@ jobs: [ "${{ needs.build_idf_hw_vibration.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_ble_proxy_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_media_player_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - - echo "📋 Latest ESPHome: $SUCCESS/$TOTAL builds passed" - + + echo "📋 ESPHome (Latest): $SUCCESS/$TOTAL builds passed" + if [ "$SUCCESS" -eq "$TOTAL" ]; then echo "✅ All builds on latest ESPHome successful!" else @@ -389,7 +396,8 @@ jobs: summary_dev: name: "📊 ESPHome (Dev)" - needs: [build_ard_ble_proxy_dev, build_ard_media_player_dev, build_idf_ble_proxy_dev, build_idf_media_player_dev] + needs: [build_ard_ble_proxy_dev, build_ard_media_player_dev, build_idf_ble_proxy_dev, + build_idf_media_player_dev] if: always() && !inputs.skip_dev runs-on: ubuntu-latest steps: @@ -397,17 +405,17 @@ jobs: run: | SUCCESS=0 TOTAL=4 - + # Arduino Dev builds [ "${{ needs.build_ard_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_media_player_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - + # ESP-IDF Dev builds [ "${{ needs.build_idf_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_media_player_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - - echo "🚀 Dev ESPHome: $SUCCESS/$TOTAL builds passed" - + + echo "🚀 ESPHome (Dev): $SUCCESS/$TOTAL builds passed" + if [ "$SUCCESS" -eq "$TOTAL" ]; then echo "✅ All builds on dev ESPHome successful!" else From 4c0a83851e074f2e4856dd67e0954f8ebdf9092e Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 15:54:34 +0200 Subject: [PATCH 32/51] Test basic on dev --- .github/workflows/validate_esphome.yml | 168 ++++++++++++++++++++----- 1 file changed, 140 insertions(+), 28 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index d5cc50e..0f9a45a 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -77,9 +77,24 @@ jobs: yaml-file: ".test/esphome_ard_basic.yaml" version: latest + build_ard_basic_dev: + name: "📦 Arduino Basic (dev)" + needs: build_ard_core + if: success() && !inputs.skip_dev + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Arduino Basic - dev + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_ard_basic.yaml" + version: dev + build_ard_hw_relays: name: "🔌 Arduino HW Relays (latest)" - needs: [build_ard_core, build_ard_basic] + needs: + - build_ard_core + - build_ard_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -91,7 +106,9 @@ jobs: build_ard_hw_speaker: name: "🔌 Arduino HW Speaker (latest)" - needs: [build_ard_core, build_ard_basic] + needs: + - build_ard_core + - build_ard_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -103,7 +120,9 @@ jobs: build_ard_hw_vibration: name: "🔌 Arduino HW Vibration (latest)" - needs: [build_ard_core, build_ard_basic] + needs: + - build_ard_core + - build_ard_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -115,7 +134,12 @@ jobs: build_ard_ble_proxy_latest: name: "⚡ Arduino BLE Proxy (latest)" - needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration] + needs: + - build_ard_core + - build_ard_basic + - build_ard_hw_relays + - build_ard_hw_speaker + - build_ard_hw_vibration runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -127,7 +151,12 @@ jobs: build_ard_ble_proxy_dev: name: "⚡ Arduino BLE Proxy (dev)" - needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration] + needs: + - build_ard_core + - build_ard_basic + - build_ard_hw_relays + - build_ard_hw_speaker + - build_ard_hw_vibration if: success() && !inputs.skip_dev runs-on: ubuntu-latest steps: @@ -140,7 +169,12 @@ jobs: build_ard_media_player_latest: name: "⚡ Arduino Media Player (latest)" - needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration] + needs: + - build_ard_core + - build_ard_basic + - build_ard_hw_relays + - build_ard_hw_speaker + - build_ard_hw_vibration runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -152,7 +186,12 @@ jobs: build_ard_media_player_dev: name: "⚡ Arduino Media Player (dev)" - needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, build_ard_hw_vibration] + needs: + - build_ard_core + - build_ard_basic + - build_ard_hw_relays + - build_ard_hw_speaker + - build_ard_hw_vibration if: success() && !inputs.skip_dev runs-on: ubuntu-latest steps: @@ -188,6 +227,19 @@ jobs: yaml-file: ".test/esphome_idf_basic.yaml" version: latest + build_idf_basic_dev: + name: "📦 IDF Basic (dev)" + needs: build_idf_core + if: success() && !inputs.skip_dev + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build IDF Basic - dev + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_basic.yaml" + version: dev + build_idf_hw_relays: name: "🔌 IDF HW Relays (latest)" needs: [build_idf_core, build_idf_basic] @@ -202,7 +254,9 @@ jobs: build_idf_hw_speaker: name: "🔌 IDF HW Speaker (latest)" - needs: [build_idf_core, build_idf_basic] + needs: + - build_idf_core + - build_idf_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -214,7 +268,9 @@ jobs: build_idf_hw_vibration: name: "🔌 IDF HW Vibration (latest)" - needs: [build_idf_core, build_idf_basic] + needs: + - build_idf_core + - build_idf_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -226,7 +282,12 @@ jobs: build_idf_ble_proxy_latest: name: "⚡ IDF BLE Proxy (latest)" - needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration] + needs: + - build_idf_core + - build_idf_basic + - build_idf_hw_relays + - build_idf_hw_speaker + - build_idf_hw_vibration runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -238,7 +299,12 @@ jobs: build_idf_ble_proxy_dev: name: "⚡ IDF BLE Proxy (dev)" - needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration] + needs: + - build_idf_core + - build_idf_basic + - build_idf_hw_relays + - build_idf_hw_speaker + - build_idf_hw_vibration if: success() && !inputs.skip_dev runs-on: ubuntu-latest steps: @@ -251,7 +317,12 @@ jobs: build_idf_media_player_latest: name: "⚡ IDF Media Player (latest)" - needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration] + needs: + - build_idf_core + - build_idf_basic + - build_idf_hw_relays + - build_idf_hw_speaker + - build_idf_hw_vibration runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -263,7 +334,12 @@ jobs: build_idf_media_player_dev: name: "⚡ IDF Media Player (dev)" - needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, build_idf_hw_vibration] + needs: + - build_idf_core + - build_idf_basic + - build_idf_hw_relays + - build_idf_hw_speaker + - build_idf_hw_vibration if: success() && !inputs.skip_dev runs-on: ubuntu-latest steps: @@ -277,9 +353,17 @@ jobs: # Summary Jobs - Grouped by framework and environment summary_arduino: name: "📊 Arduino Framework" - needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, - build_ard_hw_vibration, build_ard_ble_proxy_latest, build_ard_ble_proxy_dev, - build_ard_media_player_latest, build_ard_media_player_dev] + needs: + - build_ard_core + - build_ard_basic + - build_ard_basic_dev + - build_ard_hw_relays + - build_ard_hw_speaker + - build_ard_hw_vibration + - build_ard_ble_proxy_latest + - build_ard_ble_proxy_dev + - build_ard_media_player_latest + - build_ard_media_player_dev if: always() runs-on: ubuntu-latest steps: @@ -300,9 +384,10 @@ jobs: # Count dev builds (if not skipped) if [ "${{ inputs.skip_dev }}" != "true" ]; then + [ "${{ needs.build_ard_basic_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_media_player_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - TOTAL=$((TOTAL + 2)) + TOTAL=$((TOTAL + 3)) fi echo "🤖 Arduino Framework: $SUCCESS/$TOTAL builds passed" @@ -316,9 +401,17 @@ jobs: summary_idf: name: "📊 ESP-IDF Framework" - needs: [build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, - build_idf_hw_vibration, build_idf_ble_proxy_latest, build_idf_ble_proxy_dev, - build_idf_media_player_latest, build_idf_media_player_dev] + needs: + - build_idf_core + - build_idf_basic + - build_idf_basic_dev + - build_idf_hw_relays + - build_idf_hw_speaker + - build_idf_hw_vibration + - build_idf_ble_proxy_latest + - build_idf_ble_proxy_dev + - build_idf_media_player_latest + - build_idf_media_player_dev if: always() runs-on: ubuntu-latest steps: @@ -339,9 +432,10 @@ jobs: # Count dev builds (if not skipped) if [ "${{ inputs.skip_dev }}" != "true" ]; then + [ "${{ needs.build_idf_basic_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_media_player_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - TOTAL=$((TOTAL + 2)) + TOTAL=$((TOTAL + 3)) fi echo "🔧 ESP-IDF Framework: $SUCCESS/$TOTAL builds passed" @@ -355,10 +449,21 @@ jobs: summary_latest: name: "📊 ESPHome (Latest)" - needs: [build_ard_core, build_ard_basic, build_ard_hw_relays, build_ard_hw_speaker, - build_ard_hw_vibration, build_ard_ble_proxy_latest, build_ard_media_player_latest, - build_idf_core, build_idf_basic, build_idf_hw_relays, build_idf_hw_speaker, - build_idf_hw_vibration, build_idf_ble_proxy_latest, build_idf_media_player_latest] + needs: + - build_ard_core + - build_ard_basic + - build_ard_hw_relays + - build_ard_hw_speaker + - build_ard_hw_vibration + - build_ard_ble_proxy_latest + - build_ard_media_player_latest + - build_idf_core + - build_idf_basic + - build_idf_hw_relays + - build_idf_hw_speaker + - build_idf_hw_vibration + - build_idf_ble_proxy_latest + - build_idf_media_player_latest if: always() runs-on: ubuntu-latest steps: @@ -396,21 +501,28 @@ jobs: summary_dev: name: "📊 ESPHome (Dev)" - needs: [build_ard_ble_proxy_dev, build_ard_media_player_dev, build_idf_ble_proxy_dev, - build_idf_media_player_dev] + needs: + - build_ard_basic_dev + - build_ard_ble_proxy_dev + - build_ard_media_player_dev + - build_idf_basic_dev + - build_idf_ble_proxy_dev + - build_idf_media_player_dev if: always() && !inputs.skip_dev runs-on: ubuntu-latest steps: - name: Dev ESPHome Results run: | SUCCESS=0 - TOTAL=4 + TOTAL=6 # Arduino Dev builds + [ "${{ needs.build_ard_basic_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_media_player_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) # ESP-IDF Dev builds + [ "${{ needs.build_idf_basic_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_media_player_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) From 29b292bf45f6877cb525acf0ff08f04e24284936 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 16:00:40 +0200 Subject: [PATCH 33/51] Fix dependencies --- .github/workflows/validate_esphome.yml | 68 +++++--------------------- 1 file changed, 12 insertions(+), 56 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index 0f9a45a..4e26a85 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -92,9 +92,7 @@ jobs: build_ard_hw_relays: name: "🔌 Arduino HW Relays (latest)" - needs: - - build_ard_core - - build_ard_basic + needs: build_ard_core runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -106,9 +104,7 @@ jobs: build_ard_hw_speaker: name: "🔌 Arduino HW Speaker (latest)" - needs: - - build_ard_core - - build_ard_basic + needs: build_ard_core runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -120,9 +116,7 @@ jobs: build_ard_hw_vibration: name: "🔌 Arduino HW Vibration (latest)" - needs: - - build_ard_core - - build_ard_basic + needs: build_ard_core runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -134,12 +128,7 @@ jobs: build_ard_ble_proxy_latest: name: "⚡ Arduino BLE Proxy (latest)" - needs: - - build_ard_core - - build_ard_basic - - build_ard_hw_relays - - build_ard_hw_speaker - - build_ard_hw_vibration + needs: build_ard_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -151,12 +140,7 @@ jobs: build_ard_ble_proxy_dev: name: "⚡ Arduino BLE Proxy (dev)" - needs: - - build_ard_core - - build_ard_basic - - build_ard_hw_relays - - build_ard_hw_speaker - - build_ard_hw_vibration + needs: build_ard_basic_dev if: success() && !inputs.skip_dev runs-on: ubuntu-latest steps: @@ -170,10 +154,8 @@ jobs: build_ard_media_player_latest: name: "⚡ Arduino Media Player (latest)" needs: - - build_ard_core - build_ard_basic - build_ard_hw_relays - - build_ard_hw_speaker - build_ard_hw_vibration runs-on: ubuntu-latest steps: @@ -186,12 +168,7 @@ jobs: build_ard_media_player_dev: name: "⚡ Arduino Media Player (dev)" - needs: - - build_ard_core - - build_ard_basic - - build_ard_hw_relays - - build_ard_hw_speaker - - build_ard_hw_vibration + needs: build_ard_basic_dev if: success() && !inputs.skip_dev runs-on: ubuntu-latest steps: @@ -242,7 +219,7 @@ jobs: build_idf_hw_relays: name: "🔌 IDF HW Relays (latest)" - needs: [build_idf_core, build_idf_basic] + needs: build_idf_core runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -254,9 +231,7 @@ jobs: build_idf_hw_speaker: name: "🔌 IDF HW Speaker (latest)" - needs: - - build_idf_core - - build_idf_basic + needs: build_idf_core runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -268,9 +243,7 @@ jobs: build_idf_hw_vibration: name: "🔌 IDF HW Vibration (latest)" - needs: - - build_idf_core - - build_idf_basic + needs: build_idf_core runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -282,12 +255,7 @@ jobs: build_idf_ble_proxy_latest: name: "⚡ IDF BLE Proxy (latest)" - needs: - - build_idf_core - - build_idf_basic - - build_idf_hw_relays - - build_idf_hw_speaker - - build_idf_hw_vibration + needs: build_idf_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -299,12 +267,7 @@ jobs: build_idf_ble_proxy_dev: name: "⚡ IDF BLE Proxy (dev)" - needs: - - build_idf_core - - build_idf_basic - - build_idf_hw_relays - - build_idf_hw_speaker - - build_idf_hw_vibration + needs: build_idf_basic_dev if: success() && !inputs.skip_dev runs-on: ubuntu-latest steps: @@ -318,10 +281,8 @@ jobs: build_idf_media_player_latest: name: "⚡ IDF Media Player (latest)" needs: - - build_idf_core - build_idf_basic - build_idf_hw_relays - - build_idf_hw_speaker - build_idf_hw_vibration runs-on: ubuntu-latest steps: @@ -334,12 +295,7 @@ jobs: build_idf_media_player_dev: name: "⚡ IDF Media Player (dev)" - needs: - - build_idf_core - - build_idf_basic - - build_idf_hw_relays - - build_idf_hw_speaker - - build_idf_hw_vibration + needs: build_idf_basic_dev if: success() && !inputs.skip_dev runs-on: ubuntu-latest steps: From b99a6b8c548e5b0081d64c7717a5625c14cf305c Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 16:06:11 +0200 Subject: [PATCH 34/51] Fail-fast - Test basic before hardware --- .github/workflows/validate_esphome.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index 4e26a85..64f98fd 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -92,7 +92,7 @@ jobs: build_ard_hw_relays: name: "🔌 Arduino HW Relays (latest)" - needs: build_ard_core + needs: build_ard_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -104,7 +104,7 @@ jobs: build_ard_hw_speaker: name: "🔌 Arduino HW Speaker (latest)" - needs: build_ard_core + needs: build_ard_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -116,7 +116,7 @@ jobs: build_ard_hw_vibration: name: "🔌 Arduino HW Vibration (latest)" - needs: build_ard_core + needs: build_ard_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -219,7 +219,7 @@ jobs: build_idf_hw_relays: name: "🔌 IDF HW Relays (latest)" - needs: build_idf_core + needs: build_idf_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -231,7 +231,7 @@ jobs: build_idf_hw_speaker: name: "🔌 IDF HW Speaker (latest)" - needs: build_idf_core + needs: build_idf_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -243,7 +243,7 @@ jobs: build_idf_hw_vibration: name: "🔌 IDF HW Vibration (latest)" - needs: build_idf_core + needs: build_idf_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main From ba041a9d50acf9514456f88fe5f5d73e74b9e7de Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Tue, 29 Jul 2025 21:19:21 +0200 Subject: [PATCH 35/51] Set audio channel to `mono` --- ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml index 3dcabb1..e13658d 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml @@ -20,6 +20,8 @@ i2s_audio: id: if_i2s_audio i2s_bclk_pin: GPIO2 i2s_lrclk_pin: GPIO4 + i2s_comm_fmt: stand_msb + channel: mono script: - id: !extend dump_config_list_packages From 912607d1ecc590c8f5a7edad22953123b6efb73f Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Wed, 30 Jul 2025 07:28:05 +0200 Subject: [PATCH 36/51] Refine speaker settings for esp-idf Solves #95 --- ...timate-Easy-ESPHome_standard_hw_audio.yaml | 8 +++--- ...mate-Easy-ESPHome_standard_hw_speaker.yaml | 15 +++++++++++ ...te-Easy-ESPHome_standard_media_player.yaml | 25 +++++++++++-------- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml index e13658d..63253ac 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml @@ -17,11 +17,9 @@ esphome: - -D TX_ULTIMATE_EASY_STANDARD_HW_AUDIO i2s_audio: - id: if_i2s_audio - i2s_bclk_pin: GPIO2 - i2s_lrclk_pin: GPIO4 - i2s_comm_fmt: stand_msb - channel: mono + - id: if_i2s_audio + i2s_bclk_pin: GPIO2 + i2s_lrclk_pin: GPIO4 script: - id: !extend dump_config_list_packages diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml index 0bfe4ad..774181c 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml @@ -179,4 +179,19 @@ speaker: i2s_audio_id: if_i2s_audio i2s_comm_fmt: stand_msb channel: mono + #timeout: never + #bits_per_sample: 16bit + #sample_rate: 48000 + #buffer_duration: 500ms + +switch: + - id: sw_speaker_amplifier + name: Speaker - Amplifier + platform: gpio + pin: + number: GPIO26 + inverted: true + restore_mode: ALWAYS_OFF + internal: true + entity_category: config ... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml index 2759029..accb35e 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml @@ -24,10 +24,24 @@ media_player: name: Media Player internal: false platform: speaker + codec_support_enabled: true + buffer_size: 250000 + task_stack_in_psram: false announcement_pipeline: speaker: announcement_spk_resampling_input + #format: WAV + #num_channels: 1 + #sample_rate: 48000 media_pipeline: speaker: media_spk_resampling_input + #format: FLAC + #num_channels: 1 + #sample_rate: 48000 + #on_announcement: + # - mixer_speaker.apply_ducking: + # id: media_speaker_embedded + # decibel_reduction: 20 + # duration: 0.0s script: - id: !extend dump_config_list_packages @@ -58,15 +72,4 @@ speaker: - platform: resampler id: media_spk_resampling_input output_speaker: media_speaker_embedded - -switch: - - id: sw_speaker_amplifier - name: Speaker - Amplifier - platform: gpio - pin: - number: GPIO26 - inverted: true - restore_mode: RESTORE_DEFAULT_ON - internal: true - entity_category: config ... From a4340da83604dd0a0c39fa49d259ce3cda842851 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Wed, 30 Jul 2025 07:31:17 +0200 Subject: [PATCH 37/51] Lint --- ...timate-Easy-ESPHome_standard_hw_speaker.yaml | 8 ++++---- ...mate-Easy-ESPHome_standard_media_player.yaml | 17 ++++++----------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml index 774181c..ce02afa 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml @@ -179,10 +179,10 @@ speaker: i2s_audio_id: if_i2s_audio i2s_comm_fmt: stand_msb channel: mono - #timeout: never - #bits_per_sample: 16bit - #sample_rate: 48000 - #buffer_duration: 500ms + # timeout: never + # bits_per_sample: 16bit + # sample_rate: 48000 + # buffer_duration: 500ms switch: - id: sw_speaker_amplifier diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml index accb35e..25255e9 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml @@ -29,19 +29,14 @@ media_player: task_stack_in_psram: false announcement_pipeline: speaker: announcement_spk_resampling_input - #format: WAV - #num_channels: 1 - #sample_rate: 48000 + # format: WAV + # num_channels: 1 + # sample_rate: 48000 media_pipeline: speaker: media_spk_resampling_input - #format: FLAC - #num_channels: 1 - #sample_rate: 48000 - #on_announcement: - # - mixer_speaker.apply_ducking: - # id: media_speaker_embedded - # decibel_reduction: 20 - # duration: 0.0s + # format: FLAC + # num_channels: 1 + # sample_rate: 48000 script: - id: !extend dump_config_list_packages From 5aecb343f671cfbfc2594199cdecc7af5a620c3c Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Wed, 30 Jul 2025 19:00:54 +0200 Subject: [PATCH 38/51] Return full audio settings --- ...-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml | 14 +++++++------- ...ltimate-Easy-ESPHome_standard_media_player.yaml | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml index ce02afa..666cf91 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml @@ -178,11 +178,11 @@ speaker: i2s_dout_pin: GPIO15 i2s_audio_id: if_i2s_audio i2s_comm_fmt: stand_msb - channel: mono - # timeout: never - # bits_per_sample: 16bit - # sample_rate: 48000 - # buffer_duration: 500ms + channel: stereo + timeout: never + bits_per_sample: 16bit + sample_rate: 48000 + buffer_duration: 500ms switch: - id: sw_speaker_amplifier @@ -190,8 +190,8 @@ switch: platform: gpio pin: number: GPIO26 - inverted: true - restore_mode: ALWAYS_OFF + inverted: false + restore_mode: ALWAYS_ON internal: true entity_category: config ... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml index 25255e9..98c2733 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml @@ -29,14 +29,14 @@ media_player: task_stack_in_psram: false announcement_pipeline: speaker: announcement_spk_resampling_input - # format: WAV - # num_channels: 1 - # sample_rate: 48000 + format: WAV + num_channels: 1 + sample_rate: 48000 media_pipeline: speaker: media_spk_resampling_input - # format: FLAC - # num_channels: 1 - # sample_rate: 48000 + format: FLAC + num_channels: 1 + sample_rate: 48000 script: - id: !extend dump_config_list_packages From e53334ac1838b7036de7546080b7ffefc570ed4f Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 31 Jul 2025 07:21:48 +0200 Subject: [PATCH 39/51] Clarify support to `bluetooth_proxy` --- README.md | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 82cec00..9a81137 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ All device behaviors can be customized through Home Assistant automations withou - **Flexible Light Control**: Customize LED behavior and effects - **Touch Panel Support**: Full support for touch gestures and multi-touch capabilities - **Advanced Automations**: Create complex automations using Home Assistant's powerful automation engine -- **BLE Proxy Support**: Optional Bluetooth Low Energy proxy functionality +- **Bluetooth Proxy Support**: Compatible with ESPHome's bluetooth_proxy component for BLE device integration - **Audio Feedback**: Built-in speaker support for audible feedback - **Haptic Feedback**: Vibration motor support for tactile feedback - **ESP-IDF Framework**: Enhanced performance and stability with ESP-IDF support @@ -166,7 +166,6 @@ Follow these steps to get your TX Ultimate device up and running with ESPHome. files: - ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml # Core (essential) packages - ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml # Non-essential, but recommended packages - # - ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml # Adds BLE proxy support ``` You can also use a specific version tag for better control over updates: ```yaml @@ -191,6 +190,27 @@ Follow these steps to get your TX Ultimate device up and running with ESPHome. > ap: # Access point configuration > ``` +### Optional Features + +#### Bluetooth Proxy +TX Ultimate Easy is fully compatible with ESPHome's `bluetooth_proxy` component. +To enable Bluetooth proxy functionality, add the following to your device configuration: + +```yaml +bluetooth_proxy: + # Optional: Configure specific settings + # active: true +``` + +**Requirements for Bluetooth Proxy:** +- ESP-IDF framework (default framework, not recommended with Arduino framework) +- Sufficient memory (TX Ultimate Easy components are compatible, + but adding additional custom components may require memory optimization) + +> [!NOTE] +> Bluetooth proxy functionality is provided by ESPHome's native component. +> TX Ultimate Easy ensures compatibility but does not include it by default to maintain optimal memory usage. + ### Advanced Settings For more granular control over components, you can use our [advanced configuration template](TX-Ultimate-Easy-ESPHome_advanced.yaml). @@ -221,6 +241,9 @@ packages: # Audio options (use none or choose only one - using both will fail) - ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml # Media player (Recommended for most users) # - ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml # Basic speaker + +# Optional: Add Bluetooth proxy support +bluetooth_proxy: ``` > [!NOTE] @@ -345,7 +368,7 @@ After installation, you can: 2. Customize touch behaviors 3. Set up LED patterns and effects 4. Create automations -5. Enable optional features like BLE proxy +5. Enable optional features like Bluetooth proxy ## Configuration Options @@ -356,6 +379,7 @@ TX Ultimate Easy offers extensive configuration options: - Relay modes and functions - Audio and haptic feedback settings - Network and connectivity options +- Optional Bluetooth proxy functionality ## Contributing From 796eb7620cd4846722ebae97f1dc52c8bdea2461 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 31 Jul 2025 10:26:37 +0200 Subject: [PATCH 40/51] Remember Media Player volume --- ...imate-Easy-ESPHome_addon_media_player.yaml | 68 -------------- ...ate-Easy-ESPHome_core_hw_media_player.yaml | 29 ------ ...timate-Easy-ESPHome_standard_hw_audio.yaml | 11 +++ ...mate-Easy-ESPHome_standard_hw_speaker.yaml | 13 +-- ...te-Easy-ESPHome_standard_media_player.yaml | 88 ++++++++++++++++++- 5 files changed, 96 insertions(+), 113 deletions(-) delete mode 100644 ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml delete mode 100644 ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_media_player.yaml diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml deleted file mode 100644 index d6985fb..0000000 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml +++ /dev/null @@ -1,68 +0,0 @@ -#################################################################################################### -##### TX Ultimate Easy for ESPHome ##### -##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy ##### -#################################################################################################### -##### Purpose: ESPHome - Add-on - Media player ##### -#################################################################################################### -##### Author: edwardtfn - https://github.com/edwardtfn - https://buymeacoffee.com/edwardfirmo ##### -#################################################################################################### -##### NOTE: ##### -##### - Make changes ONLY if absolutely necessary and you have the required knowledge. ##### -##### - For normal system use, modifications to this file are NOT required. ##### -#################################################################################################### ---- -packages: - standard_hw_audio: !include TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml - -esp32: - framework: - type: arduino - -esphome: - platformio_options: - build_flags: - - -D TX_ULTIMATE_EASY_ADDON_MEDIA_PLAYER - -media_player: - - id: mp_media_player - name: Media Player - internal: false - platform: i2s_audio - i2s_dout_pin: GPIO15 - i2s_audio_id: if_i2s_audio - i2s_comm_fmt: msb - dac_type: external - mode: mono - mute_pin: - number: GPIO26 - inverted: true - allow_other_uses: true - -script: - - id: !extend dump_config_list_packages - then: - - script.wait: dump_config - - lambda: |- - // Check for requirements - #if !defined(TX_ULTIMATE_EASY_CORE) - #error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required." - #endif - #if !defined(TX_ULTIMATE_EASY_STANDARD_HW_AUDIO) - #error "The package TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml is required." - #endif - - // Identify itself - ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Add-on - Media Player"); - -switch: - - id: sw_speaker_amplifier - name: Speaker - Amplifier - platform: gpio - pin: - number: GPIO26 - inverted: true - allow_other_uses: true - restore_mode: RESTORE_DEFAULT_ON - internal: true - entity_category: config -... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_media_player.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_media_player.yaml deleted file mode 100644 index d206ea6..0000000 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_media_player.yaml +++ /dev/null @@ -1,29 +0,0 @@ -#################################################################################################### -##### TX Ultimate Easy for ESPHome ##### -##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy ##### -#################################################################################################### -##### Purpose: ESPHome Core - Hardware - Media player ##### -#################################################################################################### -##### Author: edwardtfn - https://github.com/edwardtfn - https://buymeacoffee.com/edwardfirmo ##### -#################################################################################################### -##### NOTE: ##### -##### - Make changes ONLY if absolutely necessary and you have the required knowledge. ##### -##### - For normal system use, modifications to this file are NOT required. ##### -#################################################################################################### ---- -i2s_audio: - id: if_i2s_audio - i2s_bclk_pin: GPIO2 - i2s_lrclk_pin: GPIO4 - -media_player: - - id: mp_media_player - name: Media Player - internal: false - platform: i2s_audio - i2s_dout_pin: GPIO15 - i2s_audio_id: if_i2s_audio - i2s_comm_fmt: msb # Experimental - It was 'lsb' until v2024.12.12 - dac_type: external - mode: mono -... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml index 63253ac..6491d84 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml @@ -33,4 +33,15 @@ script: // Identify itself ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Standard - Hardware - Audio"); + +switch: + - id: sw_enable_audio + name: Enable Audio + platform: gpio + pin: + number: GPIO26 + inverted: true + restore_mode: RESTORE_DEFAULT_ON + internal: true + entity_category: config ... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml index 666cf91..bec1026 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml @@ -42,7 +42,7 @@ esphome: number: - id: speaker_volume - name: Sound - Volume + name: Volume - Speaker platform: template max_value: 100 min_value: 0 @@ -183,15 +183,4 @@ speaker: bits_per_sample: 16bit sample_rate: 48000 buffer_duration: 500ms - -switch: - - id: sw_speaker_amplifier - name: Speaker - Amplifier - platform: gpio - pin: - number: GPIO26 - inverted: false - restore_mode: ALWAYS_ON - internal: true - entity_category: config ... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml index 98c2733..ba1a16b 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml @@ -17,7 +17,13 @@ packages: esphome: platformio_options: build_flags: - - -D TX_ULTIMATE_EASY_ADDON_MEDIA_PLAYER + - -D TX_ULTIMATE_EASY_STANDARD_MEDIA_PLAYER + +globals: + - id: last_media_player_volume + type: uint8_t + restore_value: false + initial_value: '100' media_player: - id: mp_media_player @@ -37,8 +43,66 @@ media_player: format: FLAC num_channels: 1 sample_rate: 48000 + mute_pin: + number: GPIO26 + inverted: true + allow_other_uses: true + on_state: + then: + - lambda: |- + // Check if volume has changed and update number entity + uint8_t current_volume_percentage = static_cast(mp_media_player->volume * 100.0f); + if (abs(static_cast(current_volume_percentage) - static_cast(id(last_media_player_volume))) > 1) { // 1% threshold + id(last_media_player_volume) = current_volume_percentage; + ESP_LOGD("media_player_volume", "Media player volume changed to %" PRIu8 "%%, updating number entity", current_volume_percentage); + nr_media_player_volume->publish_state(static_cast(current_volume_percentage)); + } + +number: + - id: nr_media_player_volume + name: Volume - Media Player + icon: mdi:volume-high + unit_of_measurement: "%" + internal: false + entity_category: config + platform: template + min_value: 0 + max_value: 100 + step: 1 + initial_value: 100 + optimistic: false + restore_value: true + lambda: |- + // Return current media player volume as percentage + return mp_media_player->volume * 100.0f; + set_action: + then: + - media_player.volume_set: + id: mp_media_player + volume: !lambda return x / 100.0f; + - lambda: |- + id(last_media_player_volume) = static_cast(x); + ESP_LOGD("media_player_volume", "Setting media player volume to %.1f%% (%.3f)", x, x / 100.0f); + on_value: + then: + - lambda: |- + // Update our tracking variable when number entity changes + id(last_media_player_volume) = static_cast(x); + ESP_LOGVV("media_player_volume", "Number entity changed to %.1f%%", x); script: + - id: !extend boot_sequence + then: + - script.execute: sync_initial_volume + + - id: !extend dump_config + then: + - lambda: |- + // Volume sync configuration + ESP_LOGCONFIG("standard_media_player", "Media Player Volume Sync:"); + ESP_LOGCONFIG("standard_media_player", " Current volume: %.1f%%", mp_media_player->volume * 100.0f); + ESP_LOGCONFIG("standard_media_player", " Number entity: %.1f%%", nr_media_player_volume->state); + - id: !extend dump_config_list_packages then: - script.wait: dump_config @@ -46,13 +110,24 @@ script: // Check for requirements #if !defined(TX_ULTIMATE_EASY_CORE) #error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required." - #endif + #endif // TX_ULTIMATE_EASY_CORE #if !defined(TX_ULTIMATE_EASY_STANDARD_HW_SPEAKER) #error "The package TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml is required." - #endif + #endif // TX_ULTIMATE_EASY_STANDARD_HW_SPEAKER // Identify itself - ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Add-on - Media Player"); + ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Standard - Media Player"); + + - id: sync_initial_volume + mode: restart + then: + - delay: 2s # Wait for media player to initialize + - media_player.volume_set: # Sync initial volume from persisted number entity to media player + id: mp_media_player + volume: !lambda return nr_media_player_volume->state / 100.0f; + - lambda: |- + id(last_media_player_volume) = static_cast(nr_media_player_volume->state); + ESP_LOGI("media_player_volume", "Initial volume sync: %.1f%% (restored from persistence)", nr_media_player_volume->state); speaker: - platform: mixer @@ -67,4 +142,9 @@ speaker: - platform: resampler id: media_spk_resampling_input output_speaker: media_speaker_embedded + +switch: + - id: !extend sw_enable_audio + pin: + allow_other_uses: true ... From a67f3dfd4adcce11a59f86ee21d27ff1cc101ea8 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 31 Jul 2025 10:34:03 +0200 Subject: [PATCH 41/51] Removed initial value for volume control --- ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml index ba1a16b..661768c 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml @@ -69,7 +69,6 @@ number: min_value: 0 max_value: 100 step: 1 - initial_value: 100 optimistic: false restore_value: true lambda: |- From 9edd43079b6f2afd1783af9f08db7a4128fb3ec1 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 31 Jul 2025 10:58:22 +0200 Subject: [PATCH 42/51] Use globals for persistence --- ...mate-Easy-ESPHome_standard_hw_speaker.yaml | 2 +- ...te-Easy-ESPHome_standard_media_player.yaml | 61 ++++--------------- 2 files changed, 13 insertions(+), 50 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml index bec1026..9f2220f 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml @@ -42,7 +42,7 @@ esphome: number: - id: speaker_volume - name: Volume - Speaker + name: Speaker Volume platform: template max_value: 100 min_value: 0 diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml index 661768c..203ee28 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml @@ -24,6 +24,10 @@ globals: type: uint8_t restore_value: false initial_value: '100' + - id: persistent_media_player_volume + type: uint8_t + restore_value: true + initial_value: '100' media_player: - id: mp_media_player @@ -43,52 +47,16 @@ media_player: format: FLAC num_channels: 1 sample_rate: 48000 - mute_pin: - number: GPIO26 - inverted: true - allow_other_uses: true on_state: then: - lambda: |- // Check if volume has changed and update number entity - uint8_t current_volume_percentage = static_cast(mp_media_player->volume * 100.0f); - if (abs(static_cast(current_volume_percentage) - static_cast(id(last_media_player_volume))) > 1) { // 1% threshold - id(last_media_player_volume) = current_volume_percentage; - ESP_LOGD("media_player_volume", "Media player volume changed to %" PRIu8 "%%, updating number entity", current_volume_percentage); - nr_media_player_volume->publish_state(static_cast(current_volume_percentage)); + id(persistent_media_player_volume) = static_cast(mp_media_player->volume * 100.0f); + if (id(persistent_media_player_volume) != id(last_media_player_volume)) { + id(last_media_player_volume) = id(persistent_media_player_volume); + ESP_LOGD("media_player_volume", "Media player volume changed to %" PRIu8 "%%, updating number entity", id(persistent_media_player_volume)); } -number: - - id: nr_media_player_volume - name: Volume - Media Player - icon: mdi:volume-high - unit_of_measurement: "%" - internal: false - entity_category: config - platform: template - min_value: 0 - max_value: 100 - step: 1 - optimistic: false - restore_value: true - lambda: |- - // Return current media player volume as percentage - return mp_media_player->volume * 100.0f; - set_action: - then: - - media_player.volume_set: - id: mp_media_player - volume: !lambda return x / 100.0f; - - lambda: |- - id(last_media_player_volume) = static_cast(x); - ESP_LOGD("media_player_volume", "Setting media player volume to %.1f%% (%.3f)", x, x / 100.0f); - on_value: - then: - - lambda: |- - // Update our tracking variable when number entity changes - id(last_media_player_volume) = static_cast(x); - ESP_LOGVV("media_player_volume", "Number entity changed to %.1f%%", x); - script: - id: !extend boot_sequence then: @@ -99,8 +67,8 @@ script: - lambda: |- // Volume sync configuration ESP_LOGCONFIG("standard_media_player", "Media Player Volume Sync:"); + ESP_LOGCONFIG("standard_media_player", " Persistent volume: %" PRIu8 "%", id(persistent_media_player_volume)); ESP_LOGCONFIG("standard_media_player", " Current volume: %.1f%%", mp_media_player->volume * 100.0f); - ESP_LOGCONFIG("standard_media_player", " Number entity: %.1f%%", nr_media_player_volume->state); - id: !extend dump_config_list_packages then: @@ -123,10 +91,10 @@ script: - delay: 2s # Wait for media player to initialize - media_player.volume_set: # Sync initial volume from persisted number entity to media player id: mp_media_player - volume: !lambda return nr_media_player_volume->state / 100.0f; + volume: !lambda return id(persistent_media_player_volume) / 100.0f; - lambda: |- - id(last_media_player_volume) = static_cast(nr_media_player_volume->state); - ESP_LOGI("media_player_volume", "Initial volume sync: %.1f%% (restored from persistence)", nr_media_player_volume->state); + id(last_media_player_volume) = id(persistent_media_player_volume); + ESP_LOGI("media_player_volume", "Initial volume sync: %.1f%% (restored from persistence)", id(persistent_media_player_volume)); speaker: - platform: mixer @@ -141,9 +109,4 @@ speaker: - platform: resampler id: media_spk_resampling_input output_speaker: media_speaker_embedded - -switch: - - id: !extend sw_enable_audio - pin: - allow_other_uses: true ... From 720cf3ab36781f4108da25b889f3a8308a6d361b Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 31 Jul 2025 11:18:40 +0200 Subject: [PATCH 43/51] Ensure tests call the right media player code --- .test/common_idf53.yaml | 10 ---------- .test/esphome_ard_media_player.yaml | 2 +- .test/esphome_idf_basic.yaml | 5 ----- .test/esphome_idf_media_player.yaml | 2 +- 4 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 .test/common_idf53.yaml diff --git a/.test/common_idf53.yaml b/.test/common_idf53.yaml deleted file mode 100644 index f2b9b5d..0000000 --- a/.test/common_idf53.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -packages: - common_idf: !include common_idf.yaml - -esp32: - framework: - type: esp-idf - version: 5.3.1 - platform_version: 6.9.0 -... diff --git a/.test/esphome_ard_media_player.yaml b/.test/esphome_ard_media_player.yaml index f12a529..610f2fa 100644 --- a/.test/esphome_ard_media_player.yaml +++ b/.test/esphome_ard_media_player.yaml @@ -4,5 +4,5 @@ packages: core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml standard_hw_relays_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml standard_hw_vibration_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_vibration.yaml - addon_media_player: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml + standard_media_player_media_player: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml ... diff --git a/.test/esphome_idf_basic.yaml b/.test/esphome_idf_basic.yaml index 82e7f09..d4d0357 100644 --- a/.test/esphome_idf_basic.yaml +++ b/.test/esphome_idf_basic.yaml @@ -3,9 +3,4 @@ packages: common_idf: !include common_idf.yaml core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml standard_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml - -media_player: !remove - -switch: - - id: !remove sw_speaker_amplifier ... diff --git a/.test/esphome_idf_media_player.yaml b/.test/esphome_idf_media_player.yaml index b554651..d72a555 100644 --- a/.test/esphome_idf_media_player.yaml +++ b/.test/esphome_idf_media_player.yaml @@ -4,5 +4,5 @@ packages: core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml standard_hw_relays_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml standard_hw_vibration_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_vibration.yaml - addon_media_player: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml + standard_media_player: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml ... From 0480f2ddf3dca304865ea6b8e8b8e9297bde0add Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 31 Jul 2025 11:22:29 +0200 Subject: [PATCH 44/51] Media player is already part of standard package --- .github/workflows/validate_esphome.yml | 44 -------------------------- 1 file changed, 44 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index 64f98fd..24d14e1 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -278,34 +278,6 @@ jobs: yaml-file: ".test/esphome_idf_ble_proxy.yaml" version: dev - build_idf_media_player_latest: - name: "⚡ IDF Media Player (latest)" - needs: - - build_idf_basic - - build_idf_hw_relays - - build_idf_hw_vibration - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build IDF Media Player - latest - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_media_player.yaml" - version: latest - - build_idf_media_player_dev: - name: "⚡ IDF Media Player (dev)" - needs: build_idf_basic_dev - if: success() && !inputs.skip_dev - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build IDF Media Player - dev - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf_media_player.yaml" - version: dev - # Summary Jobs - Grouped by framework and environment summary_arduino: name: "📊 Arduino Framework" @@ -318,8 +290,6 @@ jobs: - build_ard_hw_vibration - build_ard_ble_proxy_latest - build_ard_ble_proxy_dev - - build_ard_media_player_latest - - build_ard_media_player_dev if: always() runs-on: ubuntu-latest steps: @@ -335,14 +305,12 @@ jobs: [ "${{ needs.build_ard_hw_speaker.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_hw_vibration.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_ble_proxy_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - [ "${{ needs.build_ard_media_player_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) TOTAL=$((TOTAL + 7)) # Count dev builds (if not skipped) if [ "${{ inputs.skip_dev }}" != "true" ]; then [ "${{ needs.build_ard_basic_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - [ "${{ needs.build_ard_media_player_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) TOTAL=$((TOTAL + 3)) fi @@ -366,8 +334,6 @@ jobs: - build_idf_hw_vibration - build_idf_ble_proxy_latest - build_idf_ble_proxy_dev - - build_idf_media_player_latest - - build_idf_media_player_dev if: always() runs-on: ubuntu-latest steps: @@ -383,14 +349,12 @@ jobs: [ "${{ needs.build_idf_hw_speaker.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_hw_vibration.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_ble_proxy_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - [ "${{ needs.build_idf_media_player_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) TOTAL=$((TOTAL + 7)) # Count dev builds (if not skipped) if [ "${{ inputs.skip_dev }}" != "true" ]; then [ "${{ needs.build_idf_basic_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - [ "${{ needs.build_idf_media_player_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) TOTAL=$((TOTAL + 3)) fi @@ -412,14 +376,12 @@ jobs: - build_ard_hw_speaker - build_ard_hw_vibration - build_ard_ble_proxy_latest - - build_ard_media_player_latest - build_idf_core - build_idf_basic - build_idf_hw_relays - build_idf_hw_speaker - build_idf_hw_vibration - build_idf_ble_proxy_latest - - build_idf_media_player_latest if: always() runs-on: ubuntu-latest steps: @@ -435,7 +397,6 @@ jobs: [ "${{ needs.build_ard_hw_speaker.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_hw_vibration.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_ble_proxy_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - [ "${{ needs.build_ard_media_player_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) # ESP-IDF Latest builds [ "${{ needs.build_idf_core.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) @@ -444,7 +405,6 @@ jobs: [ "${{ needs.build_idf_hw_speaker.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_hw_vibration.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_ble_proxy_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - [ "${{ needs.build_idf_media_player_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) echo "📋 ESPHome (Latest): $SUCCESS/$TOTAL builds passed" @@ -460,10 +420,8 @@ jobs: needs: - build_ard_basic_dev - build_ard_ble_proxy_dev - - build_ard_media_player_dev - build_idf_basic_dev - build_idf_ble_proxy_dev - - build_idf_media_player_dev if: always() && !inputs.skip_dev runs-on: ubuntu-latest steps: @@ -475,12 +433,10 @@ jobs: # Arduino Dev builds [ "${{ needs.build_ard_basic_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - [ "${{ needs.build_ard_media_player_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) # ESP-IDF Dev builds [ "${{ needs.build_idf_basic_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - [ "${{ needs.build_idf_media_player_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) echo "🚀 ESPHome (Dev): $SUCCESS/$TOTAL builds passed" From 334932c6c8de811cdf0ec0e20373b42c993db92e Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 31 Jul 2025 11:24:33 +0200 Subject: [PATCH 45/51] Completely remove media player specific tests --- .github/workflows/validate_esphome.yml | 28 -------------------------- .test/esphome_ard_media_player.yaml | 8 -------- .test/esphome_idf_media_player.yaml | 8 -------- 3 files changed, 44 deletions(-) delete mode 100644 .test/esphome_ard_media_player.yaml delete mode 100644 .test/esphome_idf_media_player.yaml diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index 24d14e1..95c6de9 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -151,34 +151,6 @@ jobs: yaml-file: ".test/esphome_ard_ble_proxy.yaml" version: dev - build_ard_media_player_latest: - name: "⚡ Arduino Media Player (latest)" - needs: - - build_ard_basic - - build_ard_hw_relays - - build_ard_hw_vibration - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Arduino Media Player - latest - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_media_player.yaml" - version: latest - - build_ard_media_player_dev: - name: "⚡ Arduino Media Player (dev)" - needs: build_ard_basic_dev - if: success() && !inputs.skip_dev - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Arduino Media Player - dev - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_ard_media_player.yaml" - version: dev - # IDF Framework - Foundation (latest) build_idf_core: name: "🏗️ IDF Core (latest)" diff --git a/.test/esphome_ard_media_player.yaml b/.test/esphome_ard_media_player.yaml deleted file mode 100644 index 610f2fa..0000000 --- a/.test/esphome_ard_media_player.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -packages: - common_arduino: !include common_ard.yaml - core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml - standard_hw_relays_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml - standard_hw_vibration_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_vibration.yaml - standard_media_player_media_player: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml -... diff --git a/.test/esphome_idf_media_player.yaml b/.test/esphome_idf_media_player.yaml deleted file mode 100644 index d72a555..0000000 --- a/.test/esphome_idf_media_player.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -packages: - common_idf: !include common_idf.yaml - core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml - standard_hw_relays_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml - standard_hw_vibration_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_vibration.yaml - standard_media_player: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_media_player.yaml -... From 8eaa60b5c02af98a1678154b9272694cf80b25f7 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 31 Jul 2025 13:14:11 +0200 Subject: [PATCH 46/51] Update totals --- .github/workflows/validate_esphome.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index 95c6de9..a36ebb2 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -277,13 +277,13 @@ jobs: [ "${{ needs.build_ard_hw_speaker.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_hw_vibration.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_ble_proxy_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - TOTAL=$((TOTAL + 7)) + TOTAL=$((TOTAL + 6)) # Count dev builds (if not skipped) if [ "${{ inputs.skip_dev }}" != "true" ]; then [ "${{ needs.build_ard_basic_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - TOTAL=$((TOTAL + 3)) + TOTAL=$((TOTAL + 2)) fi echo "🤖 Arduino Framework: $SUCCESS/$TOTAL builds passed" @@ -321,13 +321,13 @@ jobs: [ "${{ needs.build_idf_hw_speaker.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_hw_vibration.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_ble_proxy_latest.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - TOTAL=$((TOTAL + 7)) + TOTAL=$((TOTAL + 6)) # Count dev builds (if not skipped) if [ "${{ inputs.skip_dev }}" != "true" ]; then [ "${{ needs.build_idf_basic_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) - TOTAL=$((TOTAL + 3)) + TOTAL=$((TOTAL + 2)) fi echo "🔧 ESP-IDF Framework: $SUCCESS/$TOTAL builds passed" From 8e4bbda41207b6b9c5c44350154ef93567ed499b Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 31 Jul 2025 13:29:34 +0200 Subject: [PATCH 47/51] Fix totals --- .github/workflows/validate_esphome.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index a36ebb2..b40eca5 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -360,7 +360,7 @@ jobs: - name: Latest ESPHome Results run: | SUCCESS=0 - TOTAL=14 + TOTAL=12 # Arduino Latest builds [ "${{ needs.build_ard_core.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) @@ -400,7 +400,7 @@ jobs: - name: Dev ESPHome Results run: | SUCCESS=0 - TOTAL=6 + TOTAL=4 # Arduino Dev builds [ "${{ needs.build_ard_basic_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) From ad927990352f594358b2aa77a24648cbf58e08a5 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 1 Aug 2025 08:51:33 +0200 Subject: [PATCH 48/51] Remove `gang_count_plural_suffix` and set audio channel to `mono` --- ESPHome/TX-Ultimate-Easy-ESPHome_core_common.yaml | 9 +-------- .../TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml | 11 +++++++---- .../TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_common.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_common.yaml index 85c9313..a254e28 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_common.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_common.yaml @@ -29,7 +29,6 @@ substitutions: DUMP_CONFIG_CALLER_DELAY: 10s # Delay to dump config after requested - api: id: api_server on_client_connected: @@ -101,11 +100,6 @@ globals: restore_value: true initial_value: '0' - - id: gang_count_plural_suffix - type: std::string - restore_value: true - max_restore_data_length: 3 - logger: level: DEBUG @@ -157,7 +151,6 @@ script: if (id(gang_count) < 1 || id(gang_count) > 4) { ESP_LOGE("core_hw_leds", "Invalid number of gangs: %" PRIu8, id(gang_count)); } - id(gang_count_plural_suffix) = id(gang_count) > 1 ? "s" : ""; - id: boot_sequence mode: restart @@ -193,7 +186,7 @@ script: ESP_LOGCONFIG("core", "Model format (selected): %s", sl_tx_model_format->state.c_str()); ESP_LOGCONFIG("core", "Model format (detected): %s", id(is_us_model) ? "US" : "EU"); ESP_LOGCONFIG("core", "Gangs (selected): %s", sl_tx_model_gang->state.c_str()); - ESP_LOGCONFIG("core", "Gangs (detected): %" PRIu8 "-Gang%s", id(gang_count), id(gang_count_plural_suffix).c_str()); + ESP_LOGCONFIG("core", "Gangs (detected): %" PRIu8 "-Gang%s", id(gang_count), id(gang_count) > 1 ? "s" : ""); // System state if (bs_pending_restart->state) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml index 6491d84..0894e3a 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml @@ -11,6 +11,9 @@ ##### - For normal system use, modifications to this file are NOT required. ##### #################################################################################################### --- +substitutions: + SWITCH_AUDIO_AMPLIFIER_RESTORE_MODE: RESTORE_DEFAULT_ON + esphome: platformio_options: build_flags: @@ -35,13 +38,13 @@ script: ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Standard - Hardware - Audio"); switch: - - id: sw_enable_audio - name: Enable Audio + - id: sw_audio_amplifier + name: Audio Amplifier platform: gpio pin: number: GPIO26 - inverted: true - restore_mode: RESTORE_DEFAULT_ON + inverted: false + restore_mode: ${SWITCH_AUDIO_AMPLIFIER_RESTORE_MODE} internal: true entity_category: config ... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml index 9f2220f..e84a8a1 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml @@ -178,7 +178,7 @@ speaker: i2s_dout_pin: GPIO15 i2s_audio_id: if_i2s_audio i2s_comm_fmt: stand_msb - channel: stereo + channel: mono timeout: never bits_per_sample: 16bit sample_rate: 48000 From 6687c5c6a50f27b6af169df2ccd41b31377cef75 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 1 Aug 2025 09:01:37 +0200 Subject: [PATCH 49/51] Fix other references to `gang_count_plural_suffix` --- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml | 5 +++-- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml | 5 +++-- ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml | 9 +++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml index e5c914d..8ae40fb 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml @@ -209,10 +209,11 @@ script: - id: !extend dump_config then: - lambda: |- + std:string gang_count_plural_suffix = id(gang_count) > 1 ? "s" : ""; // Button's actions ESP_LOGCONFIG("core_hw_buttons", "Button%s action%s:", - id(gang_count_plural_suffix).c_str(), - id(gang_count_plural_suffix).c_str()); + gang_count_plural_suffix.c_str(), + gang_count_plural_suffix.c_str()); ESP_LOGCONFIG("core_hw_buttons", " Relay 1: %s", sl_button_1_action->has_state() ? sl_button_1_action->state.c_str() : "Unknown"); diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml index e23d649..68fd204 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml @@ -448,10 +448,11 @@ script: - id: !extend dump_config then: - lambda: |- + std:string gang_count_plural_suffix = id(gang_count) > 1 ? "s" : ""; // Relay's LEDs modes ESP_LOGCONFIG("core_hw_leds", "Relay%s LEDs mode%s:", - id(gang_count_plural_suffix).c_str(), - id(gang_count_plural_suffix).c_str()); + gang_count_plural_suffix.c_str(), + gang_count_plural_suffix.c_str()); ESP_LOGCONFIG("core_hw_leds", " Relay 1: %s", id(is_us_model) ? sl_relay_1_light_mode_us->state.c_str() : sl_relay_1_light_mode_eu->state.c_str()); diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml index bb738ad..fe81789 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml @@ -703,10 +703,11 @@ script: - id: !extend dump_config then: - lambda: |- + std:string gang_count_plural_suffix = id(gang_count) > 1 ? "s" : ""; // Relay's modes ESP_LOGCONFIG("standard_hw_relays", "Relay%s mode%s:", - id(gang_count_plural_suffix).c_str(), - id(gang_count_plural_suffix).c_str()); + gang_count_plural_suffix.c_str(), + gang_count_plural_suffix.c_str()); ESP_LOGCONFIG("standard_hw_relays", " Relay 1: %s", sl_relay_1_mode->has_state() ? sl_relay_1_mode->state.c_str() : "Unknown"); @@ -725,8 +726,8 @@ script: // Relay's states ESP_LOGCONFIG("standard_hw_relays", "Relay%s state%s:", - id(gang_count_plural_suffix).c_str(), - id(gang_count_plural_suffix).c_str()); + gang_count_plural_suffix.c_str(), + gang_count_plural_suffix.c_str()); ESP_LOGCONFIG("standard_hw_relays", " Relay 1: %s", sw_relay_1->state ? "ON" : "OFF"); if (id(gang_count) >= 2) ESP_LOGCONFIG("standard_hw_relays", " Relay 2: %s", sw_relay_2->state ? "ON" : "OFF"); From 0a95a7f8d0c7913931bfac19177be6b23fcecac0 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 1 Aug 2025 09:10:58 +0200 Subject: [PATCH 50/51] Fix typo on `std::string` --- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml | 2 +- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml | 2 +- ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml index 8ae40fb..d2be16f 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml @@ -209,7 +209,7 @@ script: - id: !extend dump_config then: - lambda: |- - std:string gang_count_plural_suffix = id(gang_count) > 1 ? "s" : ""; + std::string gang_count_plural_suffix = id(gang_count) > 1 ? "s" : ""; // Button's actions ESP_LOGCONFIG("core_hw_buttons", "Button%s action%s:", gang_count_plural_suffix.c_str(), diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml index 68fd204..dde1066 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml @@ -448,7 +448,7 @@ script: - id: !extend dump_config then: - lambda: |- - std:string gang_count_plural_suffix = id(gang_count) > 1 ? "s" : ""; + std::string gang_count_plural_suffix = id(gang_count) > 1 ? "s" : ""; // Relay's LEDs modes ESP_LOGCONFIG("core_hw_leds", "Relay%s LEDs mode%s:", gang_count_plural_suffix.c_str(), diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml index fe81789..0f019eb 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml @@ -703,7 +703,7 @@ script: - id: !extend dump_config then: - lambda: |- - std:string gang_count_plural_suffix = id(gang_count) > 1 ? "s" : ""; + std::string gang_count_plural_suffix = id(gang_count) > 1 ? "s" : ""; // Relay's modes ESP_LOGCONFIG("standard_hw_relays", "Relay%s mode%s:", gang_count_plural_suffix.c_str(), From 526b257ad66b7cc460e57e9064955802b862a095 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 1 Aug 2025 09:28:42 +0200 Subject: [PATCH 51/51] Use `github.event.inputs.skip_dev` --- .github/workflows/validate_esphome.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index b40eca5..a4f2363 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -80,7 +80,7 @@ jobs: build_ard_basic_dev: name: "📦 Arduino Basic (dev)" needs: build_ard_core - if: success() && !inputs.skip_dev + if: success() && !github.event.inputs.skip_dev runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -141,7 +141,7 @@ jobs: build_ard_ble_proxy_dev: name: "⚡ Arduino BLE Proxy (dev)" needs: build_ard_basic_dev - if: success() && !inputs.skip_dev + if: success() && !github.event.inputs.skip_dev runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -179,7 +179,7 @@ jobs: build_idf_basic_dev: name: "📦 IDF Basic (dev)" needs: build_idf_core - if: success() && !inputs.skip_dev + if: success() && !github.event.inputs.skip_dev runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -240,7 +240,7 @@ jobs: build_idf_ble_proxy_dev: name: "⚡ IDF BLE Proxy (dev)" needs: build_idf_basic_dev - if: success() && !inputs.skip_dev + if: success() && !github.event.inputs.skip_dev runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -280,7 +280,7 @@ jobs: TOTAL=$((TOTAL + 6)) # Count dev builds (if not skipped) - if [ "${{ inputs.skip_dev }}" != "true" ]; then + if [ "${{ github.event.inputs.skip_dev }}" != "true" ]; then [ "${{ needs.build_ard_basic_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_ard_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) TOTAL=$((TOTAL + 2)) @@ -324,7 +324,7 @@ jobs: TOTAL=$((TOTAL + 6)) # Count dev builds (if not skipped) - if [ "${{ inputs.skip_dev }}" != "true" ]; then + if [ "${{ github.event.inputs.skip_dev }}" != "true" ]; then [ "${{ needs.build_idf_basic_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) [ "${{ needs.build_idf_ble_proxy_dev.result }}" == "success" ] && SUCCESS=$((SUCCESS + 1)) TOTAL=$((TOTAL + 2)) @@ -394,7 +394,7 @@ jobs: - build_ard_ble_proxy_dev - build_idf_basic_dev - build_idf_ble_proxy_dev - if: always() && !inputs.skip_dev + if: always() && !github.event.inputs.skip_dev runs-on: ubuntu-latest steps: - name: Dev ESPHome Results