From 81c6620fbf6b958e6b7fc2b7c5073585f575cfb2 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Wed, 25 Dec 2024 23:01:33 +0100 Subject: [PATCH 01/27] Split files even more --- ...Ultimate-Easy-ESPHome_addon_ble_proxy.yaml | 93 +-------- ...imate-Easy-ESPHome_addon_media_player.yaml | 51 +++++ ...X-Ultimate-Easy-ESPHome_addon_speaker.yaml | 176 ++++++++++++++++++ ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml | 17 +- ...X-Ultimate-Easy-ESPHome_core_hw_audio.yaml | 32 ++++ ...Ultimate-Easy-ESPHome_core_hw_buttons.yaml | 11 ++ ...TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml | 20 +- ...-Ultimate-Easy-ESPHome_core_hw_relays.yaml | 16 ++ ...X-Ultimate-Easy-ESPHome_core_hw_touch.yaml | 11 ++ ...timate-Easy-ESPHome_core_hw_vibration.yaml | 10 + README.md | 1 + TX-Ultimate-Easy-ESPHome.yaml | 4 +- 12 files changed, 348 insertions(+), 94 deletions(-) create mode 100644 ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml create mode 100644 ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml create mode 100644 ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml index 743450c..9f644a8 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml @@ -11,103 +11,22 @@ ##### - For normal system use, modifications to this file are NOT required. ##### #################################################################################################### --- -substitutions: - # RTTTL format: name:d=duration,o=octave,b=tempo:notes - # d=32 (32nd note), o=5 (octave 5), b=100 (tempo 100) - tone_volume_change: "scale_up:d=32,o=5,b=100:c,c#,d#,e,f#,g#,a#,b" # Use "none" to disable sound - -api: - actions: - - action: rtttl_play - variables: - # The RTTTL string for the melody to be played. - # It should follow the RTTTL format, including the melody's name, - # default settings, and a sequence of notes. - tone: string - then: - - lambda: |- - rtttl_speaker->stop(); - if (rtttl_speaker_gain->state > 0) { - ESP_LOGI("api", "Play tone: '%s'", tone.c_str()); - rtttl_speaker->play(tone.c_str()); - } - bluetooth_proxy: -esp32: - framework: - type: esp-idf - sdkconfig_options: - CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST: "y" - CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY: "y" - CONFIG_ESP32_REV_MIN_3: "y" - CONFIG_MBEDTLS_DYNAMIC_BUFFER: "y" - CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT: "y" - CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA: "y" - CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC: "y" - CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY: "y" - CONFIG_SPIRAM_RODATA: "y" - CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP: "y" - esphome: platformio_options: build_flags: - -D TX_ULTIMATE_EASY_ADDON_BLE_PROXY -light: - - id: !extend light_full - platform: esp32_rmt_led_strip - rgb_order: GRB - rmt_channel: 1 - chipset: ws2812 - type: !remove - variant: !remove - max_refresh_rate: 33ms - use_psram: true - -media_player: !remove - -number: - - id: rtttl_speaker_gain - name: Sound - Volume - platform: template - max_value: 100 - min_value: 0 - step: 1 - initial_value: 100 - unit_of_measurement: "%" - internal: false - disabled_by_default: true - entity_category: config - device_class: sound_pressure - restore_value: true - optimistic: true - set_action: - then: - - lambda: |- - rtttl_speaker->set_gain((100-(x/10.0f))/100.0f); - std::string tone_volume_change = "${tone_volume_change}"; - // Play sound if tone_volume_change is not "none" - if (x > 0 and !tone_volume_change.empty() and tone_volume_change != "none") - rtttl_speaker->play(tone_volume_change); - rtttl_speaker->dump_config(); - -rtttl: - - id: rtttl_speaker - speaker: mp_speaker - script: - id: !extend dump_config then: - lambda: |- - ESP_LOGCONFIG("addon_ble_proxy", "Add-on BLE Proxy installed"); + // Check for requirements + #if !defined(TX_ULTIMATE_EASY_CORE) + #error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required." + #endif -speaker: - - id: mp_speaker - platform: i2s_audio - dac_type: external - i2s_dout_pin: GPIO15 - i2s_audio_id: if_i2s_audio - i2s_comm_fmt: stand_msb - channel: mono + // Identify itself + ESP_LOGCONFIG("addon_ble_proxy", "Add-on BLE Proxy installed"); ... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml new file mode 100644 index 0000000..32f9b74 --- /dev/null +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml @@ -0,0 +1,51 @@ +#################################################################################################### +##### 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: + core_hw_audio: !include TX-Ultimate-Easy-ESPHome_core_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 # Experimental - It was 'lsb' until v2024.12.12 + dac_type: external + mode: mono + +script: + - id: !extend dump_config + then: + - 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_CORE_HW_AUDIO) + #error "The package TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml is required." + #endif + + // Identify itself + ESP_LOGCONFIG("addon_media_player", "Add-on Media Player installed"); +... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml new file mode 100644 index 0000000..169e62c --- /dev/null +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml @@ -0,0 +1,176 @@ +#################################################################################################### +##### TX Ultimate Easy for ESPHome ##### +##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy ##### +#################################################################################################### +##### Purpose: ESPHome - Add-on - Speaker ##### +#################################################################################################### +##### 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. ##### +#################################################################################################### +--- +substitutions: + # RTTTL format: name:d=duration,o=octave,b=tempo:notes + # d=32 (32nd note), o=5 (octave 5), b=100 (tempo 100) + tone_volume_change: "scale_up:d=32,o=5,b=100:c,c#,d#,e,f#,g#,a#,b" # Use "none" to disable sound + + click_sound: |- + [ + 0x01,0x02,0x04,0x06,0x07,0x08,0x08,0x06,0x01,0xFA,0xF4,0xEF,0xEE,0xF1,0xF7,0xFF,0x07,0x0E, + 0x11,0x11,0x10,0x0C,0x06,0xFF,0xF8,0xF1,0xEC,0xEA,0xEC,0xF2,0xF9,0xFF,0x05,0x0A,0x10,0x14, + 0x17,0x17,0x14,0x0B,0xFD,0xED,0xE0,0xD9,0xDB,0xE6,0xF7,0x0A,0x19,0x20,0x1E,0x14,0x05,0xF4, + 0xE5,0xDF,0xE4,0xF4,0x0C,0x24,0x36,0x3D,0x35,0x20,0xFF,0xDD,0xC0,0xAE,0xA9,0xB0,0xC4,0xE0, + 0x03,0x26,0x48,0x62,0x70,0x6D,0x59,0x35,0x08,0xD8,0xAC,0x8D,0x80,0x85,0x9C,0xC1,0xF0,0x21, + 0x4E,0x6F,0x7F,0x7A,0x63,0x3D,0x0F,0xE0,0xB7,0x9B,0x90,0x96,0xAC,0xCE,0xF6,0x1D,0x3C,0x50, + 0x55,0x4D,0x3A,0x20,0x04,0xEC,0xD8,0xCC,0xC9,0xCD,0xD8,0xE8,0xF9,0x0A,0x17,0x1F,0x20,0x1C, + 0x12,0x07,0xFC,0xF2,0xEC,0xEB,0xED,0xF3,0xFA,0x02,0x0A,0x10,0x12,0x12,0x0E,0x07,0xFE,0xF5, + 0xED,0xEA,0xEB,0xEF,0xF7,0x00,0x0A,0x10,0x13,0x12,0x0F,0x09,0x02,0xFB,0xF5,0xF3,0xF2,0xF3, + 0xF6,0xFB,0xFF,0x03,0x05,0x07,0x08,0x07,0x05,0x03,0x01,0xFF,0xFE,0xFC,0xFB,0xFB,0xFC,0xFC, + 0xFD,0xFE,0xFF,0x00,0x01,0x02,0x02,0x01 + ] + +packages: + core_hw_audio: !include TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml + +api: + actions: + - action: rtttl_play + variables: + # The RTTTL string for the melody to be played. + # It should follow the RTTTL format, including the melody's name, + # default settings, and a sequence of notes. + tone: string + then: + - lambda: |- + rtttl_speaker->stop(); + if (rtttl_speaker_gain->state > 0) { + ESP_LOGI("api", "Play tone: '%s'", tone.c_str()); + rtttl_speaker->play(tone.c_str()); + } + +esphome: + platformio_options: + build_flags: + - -D TX_ULTIMATE_EASY_ADDON_SPEAKER + +number: + - id: rtttl_speaker_gain + name: Sound - Volume + platform: template + max_value: 100 + min_value: 0 + step: 1 + initial_value: 100 + unit_of_measurement: "%" + internal: false + disabled_by_default: true + entity_category: config + device_class: sound_pressure + restore_value: true + optimistic: true + set_action: + then: + - lambda: |- + rtttl_speaker->set_gain((100-(x/10.0f))/100.0f); + std::string tone_volume_change = "${tone_volume_change}"; + // Play sound if tone_volume_change is not "none" + if (x > 0 and !tone_volume_change.empty() and tone_volume_change != "none") + rtttl_speaker->play(tone_volume_change); + rtttl_speaker->dump_config(); + +rtttl: + - id: rtttl_speaker + speaker: speaker_embedded + +script: + - id: !extend dump_config + then: + - 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_CORE_HW_AUDIO) + #error "The package TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml is required." + #endif + + // Identify itself + ESP_LOGCONFIG("addon_speaker", "Add-on Speaker installed"); + + - id: speaker_play_click + then: + - if: + condition: + not: + - speaker.is_playing: speaker_embedded + then: + - speaker.play: + id: speaker_embedded + data: !lambda return std::vector(${click_sound}); + - wait_until: + condition: + not: + - speaker.is_playing: speaker_embedded + - speaker.stop: speaker_embedded + + - id: !extend touch_on_multi_touch_release + then: + - script.execute: touch_on_multi_touch_release_speaker + + - id: touch_on_multi_touch_release_speaker + mode: restart + then: + - lambda: |- + if (sl_touch_speaker_feedback->state != "Disabled") + vibrate->execute(); + + - id: !extend touch_on_press + then: + - script.execute: touch_on_press_speaker + + - id: touch_on_press_speaker + mode: restart + then: + - lambda: |- + if (sl_touch_speaker_feedback->state == "On press" or sl_touch_speaker_feedback->state == "Always") + vibrate->execute(); + + - id: !extend touch_on_release + then: + - script.execute: touch_on_release_speaker + + - id: touch_on_release_speaker + mode: restart + then: + - lambda: |- + if (sl_touch_speaker_feedback->state == "On release" or sl_touch_speaker_feedback->state == "Always") + vibrate->execute(); + +select: + - id: sl_touch_speaker_feedback + name: Touch - Speaker feedback + platform: template + options: + - "Disabled" + - "On press" + - "On release" + - "Always" + initial_option: "Disabled" + optimistic: true + restore_value: true + internal: false + entity_category: config + disabled_by_default: false + icon: mdi:vibrate + +speaker: + - id: speaker_embedded + platform: i2s_audio + dac_type: external + i2s_dout_pin: GPIO15 + i2s_audio_id: if_i2s_audio + i2s_comm_fmt: stand_msb + channel: mono +... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml index 32d9c55..c6e78fd 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml @@ -31,7 +31,6 @@ packages: # yamllint disable rule:colons core_hw_buttons: !include TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml core_hw_leds: !include TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml - core_hw_media_player: !include TX-Ultimate-Easy-ESPHome_core_hw_media_player.yaml core_hw_relays: !include TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml core_hw_touch: !include TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml core_hw_vibration: !include TX-Ultimate-Easy-ESPHome_core_hw_vibration.yaml @@ -71,8 +70,22 @@ captive_portal: id: ap_captive_portal esp32: - board: esp32dev + board: esp32dev # adafruit_feather_esp32_v2 # esp32dev flash_size: 8MB + framework: + type: esp-idf + #sdkconfig_options: + #CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST: "y" + #CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY: "y" + #CONFIG_ESP32_REV_MIN_3: "y" + #CONFIG_ESPTOOLPY_FLASHSIZE_8MB: "y" + #CONFIG_MBEDTLS_DYNAMIC_BUFFER: "y" + #CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT: "y" + #CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA: "y" + #CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC: "y" + #CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY: "y" + #CONFIG_SPIRAM_RODATA: "y" + #CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP: "y" esphome: name: ${name} diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml new file mode 100644 index 0000000..c9a91e2 --- /dev/null +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml @@ -0,0 +1,32 @@ +#################################################################################################### +##### TX Ultimate Easy for ESPHome ##### +##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy ##### +#################################################################################################### +##### Purpose: ESPHome - Core - I2S Audio ##### +#################################################################################################### +##### 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. ##### +#################################################################################################### +--- +esphome: + platformio_options: + build_flags: + - -D TX_ULTIMATE_EASY_CORE_HW_AUDIO + +i2s_audio: + id: if_i2s_audio + i2s_bclk_pin: GPIO2 + i2s_lrclk_pin: GPIO4 + +script: + - id: !extend dump_config + then: + - lambda: |- + // Check for requirements + #if !defined(TX_ULTIMATE_EASY_CORE) + #error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required." + #endif +... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml index 43c8717..446e344 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml @@ -57,6 +57,11 @@ binary_sensor: internal: false <<: *binary_sensor_button_base +esphome: + platformio_options: + build_flags: + - -D TX_ULTIMATE_EASY_CORE_HW_BUTTONS + globals: - id: button_press_button type: uint8_t @@ -203,6 +208,12 @@ script: - id: !extend dump_config then: - lambda: |- + // Check for requirements + #if !defined(TX_ULTIMATE_EASY_CORE) + #error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required." + #endif + + // 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()); diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml index 087ce46..219e354 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml @@ -29,6 +29,11 @@ substitutions: LIGHT_SIDES_RESTORE_MODE: RESTORE_DEFAULT_OFF LIGHT_INDIVIDUAL_RESTORE_MODE: RESTORE_DEFAULT_OFF +esphome: + platformio_options: + build_flags: + - -D TX_ULTIMATE_EASY_CORE_HW_LEDS + globals: - id: gb_lights_1 type: std::vector @@ -42,13 +47,15 @@ light: - id: light_full name: Light - All internal: true - platform: neopixelbus - type: GRB - variant: WS2811 - # method: esp32_rmt + platform: esp32_rmt_led_strip + rgb_order: GRB + rmt_channel: 1 + chipset: ws2812 num_leds: 32 pin: GPIO13 restore_mode: ${LIGHT_FULL_RESTORE_MODE} + max_refresh_rate: 33ms + use_psram: true # Those lights are available based on the model selections - &light_partition_with_effects @@ -489,6 +496,11 @@ script: - id: !extend dump_config then: - lambda: |- + // Check for requirements + #if !defined(TX_ULTIMATE_EASY_CORE) + #error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required." + #endif + // Relay's LEDs modes ESP_LOGCONFIG("core_hw_leds", "Relay%s LEDs mode%s:", id(gang_count_plural_suffix).c_str(), diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml index ee1c16e..7fa0809 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml @@ -19,6 +19,10 @@ substitutions: RELAY_RESTORE_MODE: RESTORE_DEFAULT_OFF LIGHT_RELAYS_RESTORE_MODE: RESTORE_DEFAULT_OFF +esphome: + platformio_options: + build_flags: + - -D TX_ULTIMATE_EASY_CORE_HW_RELAYS globals: - id: boot_initialization_relays @@ -637,6 +641,12 @@ script: - id: !extend dump_config then: - lambda: |- + // Check for requirements + #if !defined(TX_ULTIMATE_EASY_CORE) + #error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required." + #endif + + // Relay's modes ESP_LOGCONFIG("core_hw_relays", "Relay%s mode%s:", id(gang_count_plural_suffix).c_str(), id(gang_count_plural_suffix).c_str()); @@ -655,6 +665,8 @@ script: ESP_LOGCONFIG("core_hw_relays", " Relay 4: %s", sl_relay_4_mode->has_state() ? sl_relay_4_mode->state.c_str() : "Unknown"); + + // Relay's states ESP_LOGCONFIG("core_hw_relays", "Relay%s state%s:", id(gang_count_plural_suffix).c_str(), id(gang_count_plural_suffix).c_str()); @@ -667,11 +679,15 @@ script: ESP_LOGCONFIG("core_hw_relays", " Relay 4: %s", sw_relay_4->state ? "ON" : "OFF"); ESP_LOGCONFIG("core_hw_relays", "Expose Relay's LEDs to Home Assistant: %s", YESNO(sw_expose_relays_leds_to_ha->state)); + + // Boot initialization statuses ESP_LOGCONFIG("core_hw_relays", "Boot initialization flags:"); ESP_LOGCONFIG("core_hw_relays", " Overall: %s", YESNO(id(boot_initialization_relays))); ESP_LOGCONFIG("core_hw_relays", " Light modes: %s", YESNO(id(boot_initialization_relays_light_modes))); ESP_LOGCONFIG("core_hw_relays", " Relay modes: %s", YESNO(id(boot_initialization_relays_relay_modes))); ESP_LOGCONFIG("core_hw_relays", " Status LEDs: %s", YESNO(id(boot_initialization_relays_relay_leds))); + + // Substitutions ESP_LOGCONFIG("core_hw_relays", "Restore modes:"); ESP_LOGCONFIG("core_hw_relays", " Relays: ${RELAY_RESTORE_MODE}"); ESP_LOGCONFIG("core_hw_relays", " Status LEDs: ${LIGHT_RELAYS_RESTORE_MODE}"); diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml index f840b9d..f5c0157 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml @@ -198,6 +198,11 @@ binary_sensor: id: bs_swipe_down state: OFF # yamllint disable-line rule:truthy +esphome: + platformio_options: + build_flags: + - -D TX_ULTIMATE_EASY_CORE_HW_TOUCH + external_components: - source: type: git @@ -286,6 +291,12 @@ script: - id: !extend dump_config then: - lambda: |- + // Check for requirements + #if !defined(TX_ULTIMATE_EASY_CORE) + #error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required." + #endif + + // Touch panel's state if (sw_touch_panel_power->state) ESP_LOGCONFIG("core_hw_touch", "Touch panel - Power: On"); else diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_vibration.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_vibration.yaml index fd19fb9..4587626 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_vibration.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_vibration.yaml @@ -32,6 +32,11 @@ button: then: - script.execute: vibrate +esphome: + platformio_options: + build_flags: + - -D TX_ULTIMATE_EASY_CORE_HW_VIBRATION + number: - id: nr_vibrating_duration name: Vibrate duration @@ -56,6 +61,11 @@ script: - id: !extend dump_config then: - lambda: |- + // Check for requirements + #if !defined(TX_ULTIMATE_EASY_CORE) + #error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required." + #endif + // Configuration ESP_LOGCONFIG("core_hw_vibration", "Touch - Vibration feedback: %s", sl_touch_vibration_feedback->state.c_str()); diff --git a/README.md b/README.md index 4918684..b6b6b29 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,7 @@ This project builds upon the work of several amazing projects and contributors: - [SmartHome yourself - SONOFF TX Ultimate for ESPHome](https://github.com/SmartHome-yourself/sonoff-tx-ultimate-for-esphome) - [Un loco y su tecnologĂ­a - Sonoff TX Ultimate with ESPHome](https://www.youtube.com/watch?v=58v8oqSQgXQ) +- @PxPert - [Sonoff TX Ultimate and Voice Assistant](https://community.home-assistant.io/t/sonoff-tx-ultimate-and-voice-assistant/682214?u=edwardtfn) Special thanks to all contributors and community members who help make this project better. diff --git a/TX-Ultimate-Easy-ESPHome.yaml b/TX-Ultimate-Easy-ESPHome.yaml index 9823def..4e1c17d 100644 --- a/TX-Ultimate-Easy-ESPHome.yaml +++ b/TX-Ultimate-Easy-ESPHome.yaml @@ -20,5 +20,7 @@ packages: refresh: 5min files: - ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml - # - ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml # Adds experimental BLE proxy support (limited) + # - ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml # Adds BLE proxy support + # - ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml # Adds experimental Media Player (limited) + # - ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml # Adds basic audio speaker support ... From f3b84e9d4e0ff158917e29a70dc63e5e92458ffe Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 26 Dec 2024 00:27:48 +0100 Subject: [PATCH 02/27] Fix calls to speaker_play_click --- ...X-Ultimate-Easy-ESPHome_addon_speaker.yaml | 20 ++++++++----------- ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml | 14 +------------ 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml index 169e62c..9d58bac 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml @@ -45,7 +45,7 @@ api: then: - lambda: |- rtttl_speaker->stop(); - if (rtttl_speaker_gain->state > 0) { + if (speaker_volume->state > 0) { ESP_LOGI("api", "Play tone: '%s'", tone.c_str()); rtttl_speaker->play(tone.c_str()); } @@ -56,7 +56,7 @@ esphome: - -D TX_ULTIMATE_EASY_ADDON_SPEAKER number: - - id: rtttl_speaker_gain + - id: speaker_volume name: Sound - Volume platform: template max_value: 100 @@ -72,13 +72,9 @@ number: optimistic: true set_action: then: - - lambda: |- - rtttl_speaker->set_gain((100-(x/10.0f))/100.0f); - std::string tone_volume_change = "${tone_volume_change}"; - // Play sound if tone_volume_change is not "none" - if (x > 0 and !tone_volume_change.empty() and tone_volume_change != "none") - rtttl_speaker->play(tone_volume_change); - rtttl_speaker->dump_config(); + - speaker.volume_set: + id: speaker_embedded + volume: !lambda return x/100.0f; rtttl: - id: rtttl_speaker @@ -124,7 +120,7 @@ script: then: - lambda: |- if (sl_touch_speaker_feedback->state != "Disabled") - vibrate->execute(); + speaker_play_click->execute(); - id: !extend touch_on_press then: @@ -135,7 +131,7 @@ script: then: - lambda: |- if (sl_touch_speaker_feedback->state == "On press" or sl_touch_speaker_feedback->state == "Always") - vibrate->execute(); + speaker_play_click->execute(); - id: !extend touch_on_release then: @@ -146,7 +142,7 @@ script: then: - lambda: |- if (sl_touch_speaker_feedback->state == "On release" or sl_touch_speaker_feedback->state == "Always") - vibrate->execute(); + speaker_play_click->execute(); select: - id: sl_touch_speaker_feedback diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml index c6e78fd..c5749a7 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml @@ -74,18 +74,6 @@ esp32: flash_size: 8MB framework: type: esp-idf - #sdkconfig_options: - #CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST: "y" - #CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY: "y" - #CONFIG_ESP32_REV_MIN_3: "y" - #CONFIG_ESPTOOLPY_FLASHSIZE_8MB: "y" - #CONFIG_MBEDTLS_DYNAMIC_BUFFER: "y" - #CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT: "y" - #CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA: "y" - #CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC: "y" - #CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY: "y" - #CONFIG_SPIRAM_RODATA: "y" - #CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP: "y" esphome: name: ${name} @@ -205,7 +193,7 @@ script: ESP_LOGCONFIG("core", "TX Ultimate firmware version: ${version}"); // Framework detection - #ifdef ARDUINO + #ifdef USE_ARDUINO ESP_LOGCONFIG("core", "Framework: Arduino"); #elif defined(USE_ESP_IDF) ESP_LOGCONFIG("core", "Framework: ESP-IDF"); From 3cf6a11bc743f43d37d526c12b9929313706423a Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 26 Dec 2024 21:59:31 +0100 Subject: [PATCH 03/27] Add Speaker amplifier switch and removed click sound from substitutions --- ...imate-Easy-ESPHome_addon_media_player.yaml | 16 +++++++++ ...X-Ultimate-Easy-ESPHome_addon_speaker.yaml | 35 ++++++++++--------- 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml index 32f9b74..6863f29 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml @@ -33,6 +33,10 @@ media_player: i2s_comm_fmt: msb # Experimental - It was 'lsb' until v2024.12.12 dac_type: external mode: mono + mute_pin: + number: GPIO26 + inverted: true + allow_other_uses: true script: - id: !extend dump_config @@ -48,4 +52,16 @@ script: // Identify itself ESP_LOGCONFIG("addon_media_player", "Add-on Media Player installed"); + +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_addon_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml index 9d58bac..be25a23 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml @@ -16,21 +16,6 @@ substitutions: # d=32 (32nd note), o=5 (octave 5), b=100 (tempo 100) tone_volume_change: "scale_up:d=32,o=5,b=100:c,c#,d#,e,f#,g#,a#,b" # Use "none" to disable sound - click_sound: |- - [ - 0x01,0x02,0x04,0x06,0x07,0x08,0x08,0x06,0x01,0xFA,0xF4,0xEF,0xEE,0xF1,0xF7,0xFF,0x07,0x0E, - 0x11,0x11,0x10,0x0C,0x06,0xFF,0xF8,0xF1,0xEC,0xEA,0xEC,0xF2,0xF9,0xFF,0x05,0x0A,0x10,0x14, - 0x17,0x17,0x14,0x0B,0xFD,0xED,0xE0,0xD9,0xDB,0xE6,0xF7,0x0A,0x19,0x20,0x1E,0x14,0x05,0xF4, - 0xE5,0xDF,0xE4,0xF4,0x0C,0x24,0x36,0x3D,0x35,0x20,0xFF,0xDD,0xC0,0xAE,0xA9,0xB0,0xC4,0xE0, - 0x03,0x26,0x48,0x62,0x70,0x6D,0x59,0x35,0x08,0xD8,0xAC,0x8D,0x80,0x85,0x9C,0xC1,0xF0,0x21, - 0x4E,0x6F,0x7F,0x7A,0x63,0x3D,0x0F,0xE0,0xB7,0x9B,0x90,0x96,0xAC,0xCE,0xF6,0x1D,0x3C,0x50, - 0x55,0x4D,0x3A,0x20,0x04,0xEC,0xD8,0xCC,0xC9,0xCD,0xD8,0xE8,0xF9,0x0A,0x17,0x1F,0x20,0x1C, - 0x12,0x07,0xFC,0xF2,0xEC,0xEB,0xED,0xF3,0xFA,0x02,0x0A,0x10,0x12,0x12,0x0E,0x07,0xFE,0xF5, - 0xED,0xEA,0xEB,0xEF,0xF7,0x00,0x0A,0x10,0x13,0x12,0x0F,0x09,0x02,0xFB,0xF5,0xF3,0xF2,0xF3, - 0xF6,0xFB,0xFF,0x03,0x05,0x07,0x08,0x07,0x05,0x03,0x01,0xFF,0xFE,0xFC,0xFB,0xFB,0xFC,0xFC, - 0xFD,0xFE,0xFF,0x00,0x01,0x02,0x02,0x01 - ] - packages: core_hw_audio: !include TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml @@ -104,7 +89,25 @@ script: then: - speaker.play: id: speaker_embedded - data: !lambda return std::vector(${click_sound}); + data: [0x01,0x02,0x04,0x06,0x07,0x08,0x08,0x06,0x01,0xFA,0xF4, + 0xEF,0xEE,0xF1,0xF7,0xFF,0x07,0x0E,0x11,0x11,0x10,0x0C, + 0x06,0xFF,0xF8,0xF1,0xEC,0xEA,0xEC,0xF2,0xF9,0xFF,0x05, + 0x0A,0x10,0x14,0x17,0x17,0x14,0x0B,0xFD,0xED,0xE0,0xD9, + 0xDB,0xE6,0xF7,0x0A,0x19,0x20,0x1E,0x14,0x05,0xF4,0xE5, + 0xDF,0xE4,0xF4,0x0C,0x24,0x36,0x3D,0x35,0x20,0xFF,0xDD, + 0xC0,0xAE,0xA9,0xB0,0xC4,0xE0,0x03,0x26,0x48,0x62,0x70, + 0x6D,0x59,0x35,0x08,0xD8,0xAC,0x8D,0x80,0x85,0x9C,0xC1, + 0xF0,0x21,0x4E,0x6F,0x7F,0x7A,0x63,0x3D,0x0F,0xE0,0xB7, + 0x9B,0x90,0x96,0xAC,0xCE,0xF6,0x1D,0x3C,0x50,0x55,0x4D, + 0x3A,0x20,0x04,0xEC,0xD8,0xCC,0xC9,0xCD,0xD8,0xE8,0xF9, + 0x0A,0x17,0x1F,0x20,0x1C,0x12,0x07,0xFC,0xF2,0xEC,0xEB, + 0xED,0xF3,0xFA,0x02,0x0A,0x10,0x12,0x12,0x0E,0x07,0xFE, + 0xF5,0xED,0xEA,0xEB,0xEF,0xF7,0x00,0x0A,0x10,0x13,0x12, + 0x0F,0x09,0x02,0xFB,0xF5,0xF3,0xF2,0xF3,0xF6,0xFB,0xFF, + 0x03,0x05,0x07,0x08,0x07,0x05,0x03,0x01,0xFF,0xFE,0xFC, + 0xFB,0xFB,0xFC,0xFC,0xFD,0xFE,0xFF,0x00,0x01,0x02,0x02, + 0x01] + - wait_until: condition: not: From fa2c5dcc29a6887b262e60488f27fcc5270305b7 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 26 Dec 2024 22:01:56 +0100 Subject: [PATCH 04/27] Lint --- ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml index 6863f29..5d0dd7d 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml @@ -34,9 +34,9 @@ media_player: dac_type: external mode: mono mute_pin: - number: GPIO26 - inverted: true - allow_other_uses: true + number: GPIO26 + inverted: true + allow_other_uses: true script: - id: !extend dump_config From 47744c7144a857056cffa4343678a244db347f71 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 26 Dec 2024 22:06:09 +0100 Subject: [PATCH 05/27] More changes covered by build test --- .github/workflows/validate_esphome_beta.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate_esphome_beta.yml b/.github/workflows/validate_esphome_beta.yml index 917dedb..c59f192 100644 --- a/.github/workflows/validate_esphome_beta.yml +++ b/.github/workflows/validate_esphome_beta.yml @@ -16,12 +16,14 @@ on: # yamllint disable-line rule:truthy pull_request: paths: - "*.yaml" - - "ESPHome/*.yaml" - - ".test/*.yaml" - "*.h" - "*.c" - "*.cpp" - "*.py" + - ".test/*.*" + - "components/*.*" + - "components/tx_ultimate_easy/*.*" + - "ESPHome/*.*" workflow_dispatch: concurrency: From f8fa9a236314cf6da01591add7fae79054ca33ec Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 26 Dec 2024 22:08:10 +0100 Subject: [PATCH 06/27] Lint --- ...X-Ultimate-Easy-ESPHome_addon_speaker.yaml | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml index be25a23..d051c0e 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml @@ -89,24 +89,24 @@ script: then: - speaker.play: id: speaker_embedded - data: [0x01,0x02,0x04,0x06,0x07,0x08,0x08,0x06,0x01,0xFA,0xF4, - 0xEF,0xEE,0xF1,0xF7,0xFF,0x07,0x0E,0x11,0x11,0x10,0x0C, - 0x06,0xFF,0xF8,0xF1,0xEC,0xEA,0xEC,0xF2,0xF9,0xFF,0x05, - 0x0A,0x10,0x14,0x17,0x17,0x14,0x0B,0xFD,0xED,0xE0,0xD9, - 0xDB,0xE6,0xF7,0x0A,0x19,0x20,0x1E,0x14,0x05,0xF4,0xE5, - 0xDF,0xE4,0xF4,0x0C,0x24,0x36,0x3D,0x35,0x20,0xFF,0xDD, - 0xC0,0xAE,0xA9,0xB0,0xC4,0xE0,0x03,0x26,0x48,0x62,0x70, - 0x6D,0x59,0x35,0x08,0xD8,0xAC,0x8D,0x80,0x85,0x9C,0xC1, - 0xF0,0x21,0x4E,0x6F,0x7F,0x7A,0x63,0x3D,0x0F,0xE0,0xB7, - 0x9B,0x90,0x96,0xAC,0xCE,0xF6,0x1D,0x3C,0x50,0x55,0x4D, - 0x3A,0x20,0x04,0xEC,0xD8,0xCC,0xC9,0xCD,0xD8,0xE8,0xF9, - 0x0A,0x17,0x1F,0x20,0x1C,0x12,0x07,0xFC,0xF2,0xEC,0xEB, - 0xED,0xF3,0xFA,0x02,0x0A,0x10,0x12,0x12,0x0E,0x07,0xFE, - 0xF5,0xED,0xEA,0xEB,0xEF,0xF7,0x00,0x0A,0x10,0x13,0x12, - 0x0F,0x09,0x02,0xFB,0xF5,0xF3,0xF2,0xF3,0xF6,0xFB,0xFF, - 0x03,0x05,0x07,0x08,0x07,0x05,0x03,0x01,0xFF,0xFE,0xFC, - 0xFB,0xFB,0xFC,0xFC,0xFD,0xFE,0xFF,0x00,0x01,0x02,0x02, - 0x01] + data: [ 0x01, 0x02, 0x04, 0x06, 0x07, 0x08, 0x08, 0x06, 0x01, 0xFA, 0xF4, + 0xEF, 0xEE, 0xF1, 0xF7, 0xFF, 0x07, 0x0E, 0x11, 0x11, 0x10, 0x0C, + 0x06, 0xFF, 0xF8, 0xF1, 0xEC, 0xEA, 0xEC, 0xF2, 0xF9, 0xFF, 0x05, + 0x0A, 0x10, 0x14, 0x17, 0x17, 0x14, 0x0B, 0xFD, 0xED, 0xE0, 0xD9, + 0xDB, 0xE6, 0xF7, 0x0A, 0x19, 0x20, 0x1E, 0x14, 0x05, 0xF4, 0xE5, + 0xDF, 0xE4, 0xF4, 0x0C, 0x24, 0x36, 0x3D, 0x35, 0x20, 0xFF, 0xDD, + 0xC0, 0xAE, 0xA9, 0xB0, 0xC4, 0xE0, 0x03, 0x26, 0x48, 0x62, 0x70, + 0x6D, 0x59, 0x35, 0x08, 0xD8, 0xAC, 0x8D, 0x80, 0x85, 0x9C, 0xC1, + 0xF0, 0x21, 0x4E, 0x6F, 0x7F, 0x7A, 0x63, 0x3D, 0x0F, 0xE0, 0xB7, + 0x9B, 0x90, 0x96, 0xAC, 0xCE, 0xF6, 0x1D, 0x3C, 0x50, 0x55, 0x4D, + 0x3A, 0x20, 0x04, 0xEC, 0xD8, 0xCC, 0xC9, 0xCD, 0xD8, 0xE8, 0xF9, + 0x0A, 0x17, 0x1F, 0x20, 0x1C, 0x12, 0x07, 0xFC, 0xF2, 0xEC, 0xEB, + 0xED, 0xF3, 0xFA, 0x02, 0x0A, 0x10, 0x12, 0x12, 0x0E, 0x07, 0xFE, + 0xF5, 0xED, 0xEA, 0xEB, 0xEF, 0xF7, 0x00, 0x0A, 0x10, 0x13, 0x12, + 0x0F, 0x09, 0x02, 0xFB, 0xF5, 0xF3, 0xF2, 0xF3, 0xF6, 0xFB, 0xFF, + 0x03, 0x05, 0x07, 0x08, 0x07, 0x05, 0x03, 0x01, 0xFF, 0xFE, 0xFC, + 0xFB, 0xFB, 0xFC, 0xFC, 0xFD, 0xFE, 0xFF, 0x00, 0x01, 0x02, 0x02, + 0x01 ] - wait_until: condition: From 493dcb0abb2381f2b6b5714cdb413495d33c7ea6 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 26 Dec 2024 22:09:48 +0100 Subject: [PATCH 07/27] Lint --- ...X-Ultimate-Easy-ESPHome_addon_speaker.yaml | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml index d051c0e..0728da7 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml @@ -89,24 +89,26 @@ script: then: - speaker.play: id: speaker_embedded - data: [ 0x01, 0x02, 0x04, 0x06, 0x07, 0x08, 0x08, 0x06, 0x01, 0xFA, 0xF4, - 0xEF, 0xEE, 0xF1, 0xF7, 0xFF, 0x07, 0x0E, 0x11, 0x11, 0x10, 0x0C, - 0x06, 0xFF, 0xF8, 0xF1, 0xEC, 0xEA, 0xEC, 0xF2, 0xF9, 0xFF, 0x05, - 0x0A, 0x10, 0x14, 0x17, 0x17, 0x14, 0x0B, 0xFD, 0xED, 0xE0, 0xD9, - 0xDB, 0xE6, 0xF7, 0x0A, 0x19, 0x20, 0x1E, 0x14, 0x05, 0xF4, 0xE5, - 0xDF, 0xE4, 0xF4, 0x0C, 0x24, 0x36, 0x3D, 0x35, 0x20, 0xFF, 0xDD, - 0xC0, 0xAE, 0xA9, 0xB0, 0xC4, 0xE0, 0x03, 0x26, 0x48, 0x62, 0x70, - 0x6D, 0x59, 0x35, 0x08, 0xD8, 0xAC, 0x8D, 0x80, 0x85, 0x9C, 0xC1, - 0xF0, 0x21, 0x4E, 0x6F, 0x7F, 0x7A, 0x63, 0x3D, 0x0F, 0xE0, 0xB7, - 0x9B, 0x90, 0x96, 0xAC, 0xCE, 0xF6, 0x1D, 0x3C, 0x50, 0x55, 0x4D, - 0x3A, 0x20, 0x04, 0xEC, 0xD8, 0xCC, 0xC9, 0xCD, 0xD8, 0xE8, 0xF9, - 0x0A, 0x17, 0x1F, 0x20, 0x1C, 0x12, 0x07, 0xFC, 0xF2, 0xEC, 0xEB, - 0xED, 0xF3, 0xFA, 0x02, 0x0A, 0x10, 0x12, 0x12, 0x0E, 0x07, 0xFE, - 0xF5, 0xED, 0xEA, 0xEB, 0xEF, 0xF7, 0x00, 0x0A, 0x10, 0x13, 0x12, - 0x0F, 0x09, 0x02, 0xFB, 0xF5, 0xF3, 0xF2, 0xF3, 0xF6, 0xFB, 0xFF, - 0x03, 0x05, 0x07, 0x08, 0x07, 0x05, 0x03, 0x01, 0xFF, 0xFE, 0xFC, - 0xFB, 0xFB, 0xFC, 0xFC, 0xFD, 0xFE, 0xFF, 0x00, 0x01, 0x02, 0x02, - 0x01 ] + data: [ + 0x01, 0x02, 0x04, 0x06, 0x07, 0x08, 0x08, 0x06, 0x01, 0xFA, 0xF4, + 0xEF, 0xEE, 0xF1, 0xF7, 0xFF, 0x07, 0x0E, 0x11, 0x11, 0x10, 0x0C, + 0x06, 0xFF, 0xF8, 0xF1, 0xEC, 0xEA, 0xEC, 0xF2, 0xF9, 0xFF, 0x05, + 0x0A, 0x10, 0x14, 0x17, 0x17, 0x14, 0x0B, 0xFD, 0xED, 0xE0, 0xD9, + 0xDB, 0xE6, 0xF7, 0x0A, 0x19, 0x20, 0x1E, 0x14, 0x05, 0xF4, 0xE5, + 0xDF, 0xE4, 0xF4, 0x0C, 0x24, 0x36, 0x3D, 0x35, 0x20, 0xFF, 0xDD, + 0xC0, 0xAE, 0xA9, 0xB0, 0xC4, 0xE0, 0x03, 0x26, 0x48, 0x62, 0x70, + 0x6D, 0x59, 0x35, 0x08, 0xD8, 0xAC, 0x8D, 0x80, 0x85, 0x9C, 0xC1, + 0xF0, 0x21, 0x4E, 0x6F, 0x7F, 0x7A, 0x63, 0x3D, 0x0F, 0xE0, 0xB7, + 0x9B, 0x90, 0x96, 0xAC, 0xCE, 0xF6, 0x1D, 0x3C, 0x50, 0x55, 0x4D, + 0x3A, 0x20, 0x04, 0xEC, 0xD8, 0xCC, 0xC9, 0xCD, 0xD8, 0xE8, 0xF9, + 0x0A, 0x17, 0x1F, 0x20, 0x1C, 0x12, 0x07, 0xFC, 0xF2, 0xEC, 0xEB, + 0xED, 0xF3, 0xFA, 0x02, 0x0A, 0x10, 0x12, 0x12, 0x0E, 0x07, 0xFE, + 0xF5, 0xED, 0xEA, 0xEB, 0xEF, 0xF7, 0x00, 0x0A, 0x10, 0x13, 0x12, + 0x0F, 0x09, 0x02, 0xFB, 0xF5, 0xF3, 0xF2, 0xF3, 0xF6, 0xFB, 0xFF, + 0x03, 0x05, 0x07, 0x08, 0x07, 0x05, 0x03, 0x01, 0xFF, 0xFE, 0xFC, + 0xFB, 0xFB, 0xFC, 0xFC, 0xFD, 0xFE, 0xFF, 0x00, 0x01, 0x02, 0x02, + 0x01 + ] - wait_until: condition: From d656f4b73f2845fc7b05cb24f619c0a77223c881 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 26 Dec 2024 22:13:27 +0100 Subject: [PATCH 08/27] Lint --- ...X-Ultimate-Easy-ESPHome_addon_speaker.yaml | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml index 0728da7..bbdacec 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml @@ -90,25 +90,24 @@ script: - speaker.play: id: speaker_embedded data: [ - 0x01, 0x02, 0x04, 0x06, 0x07, 0x08, 0x08, 0x06, 0x01, 0xFA, 0xF4, - 0xEF, 0xEE, 0xF1, 0xF7, 0xFF, 0x07, 0x0E, 0x11, 0x11, 0x10, 0x0C, - 0x06, 0xFF, 0xF8, 0xF1, 0xEC, 0xEA, 0xEC, 0xF2, 0xF9, 0xFF, 0x05, - 0x0A, 0x10, 0x14, 0x17, 0x17, 0x14, 0x0B, 0xFD, 0xED, 0xE0, 0xD9, - 0xDB, 0xE6, 0xF7, 0x0A, 0x19, 0x20, 0x1E, 0x14, 0x05, 0xF4, 0xE5, - 0xDF, 0xE4, 0xF4, 0x0C, 0x24, 0x36, 0x3D, 0x35, 0x20, 0xFF, 0xDD, - 0xC0, 0xAE, 0xA9, 0xB0, 0xC4, 0xE0, 0x03, 0x26, 0x48, 0x62, 0x70, - 0x6D, 0x59, 0x35, 0x08, 0xD8, 0xAC, 0x8D, 0x80, 0x85, 0x9C, 0xC1, - 0xF0, 0x21, 0x4E, 0x6F, 0x7F, 0x7A, 0x63, 0x3D, 0x0F, 0xE0, 0xB7, - 0x9B, 0x90, 0x96, 0xAC, 0xCE, 0xF6, 0x1D, 0x3C, 0x50, 0x55, 0x4D, - 0x3A, 0x20, 0x04, 0xEC, 0xD8, 0xCC, 0xC9, 0xCD, 0xD8, 0xE8, 0xF9, - 0x0A, 0x17, 0x1F, 0x20, 0x1C, 0x12, 0x07, 0xFC, 0xF2, 0xEC, 0xEB, - 0xED, 0xF3, 0xFA, 0x02, 0x0A, 0x10, 0x12, 0x12, 0x0E, 0x07, 0xFE, - 0xF5, 0xED, 0xEA, 0xEB, 0xEF, 0xF7, 0x00, 0x0A, 0x10, 0x13, 0x12, - 0x0F, 0x09, 0x02, 0xFB, 0xF5, 0xF3, 0xF2, 0xF3, 0xF6, 0xFB, 0xFF, - 0x03, 0x05, 0x07, 0x08, 0x07, 0x05, 0x03, 0x01, 0xFF, 0xFE, 0xFC, - 0xFB, 0xFB, 0xFC, 0xFC, 0xFD, 0xFE, 0xFF, 0x00, 0x01, 0x02, 0x02, - 0x01 - ] + 0x01, 0x02, 0x04, 0x06, 0x07, 0x08, 0x08, 0x06, 0x01, 0xFA, 0xF4, + 0xEF, 0xEE, 0xF1, 0xF7, 0xFF, 0x07, 0x0E, 0x11, 0x11, 0x10, 0x0C, + 0x06, 0xFF, 0xF8, 0xF1, 0xEC, 0xEA, 0xEC, 0xF2, 0xF9, 0xFF, 0x05, + 0x0A, 0x10, 0x14, 0x17, 0x17, 0x14, 0x0B, 0xFD, 0xED, 0xE0, 0xD9, + 0xDB, 0xE6, 0xF7, 0x0A, 0x19, 0x20, 0x1E, 0x14, 0x05, 0xF4, 0xE5, + 0xDF, 0xE4, 0xF4, 0x0C, 0x24, 0x36, 0x3D, 0x35, 0x20, 0xFF, 0xDD, + 0xC0, 0xAE, 0xA9, 0xB0, 0xC4, 0xE0, 0x03, 0x26, 0x48, 0x62, 0x70, + 0x6D, 0x59, 0x35, 0x08, 0xD8, 0xAC, 0x8D, 0x80, 0x85, 0x9C, 0xC1, + 0xF0, 0x21, 0x4E, 0x6F, 0x7F, 0x7A, 0x63, 0x3D, 0x0F, 0xE0, 0xB7, + 0x9B, 0x90, 0x96, 0xAC, 0xCE, 0xF6, 0x1D, 0x3C, 0x50, 0x55, 0x4D, + 0x3A, 0x20, 0x04, 0xEC, 0xD8, 0xCC, 0xC9, 0xCD, 0xD8, 0xE8, 0xF9, + 0x0A, 0x17, 0x1F, 0x20, 0x1C, 0x12, 0x07, 0xFC, 0xF2, 0xEC, 0xEB, + 0xED, 0xF3, 0xFA, 0x02, 0x0A, 0x10, 0x12, 0x12, 0x0E, 0x07, 0xFE, + 0xF5, 0xED, 0xEA, 0xEB, 0xEF, 0xF7, 0x00, 0x0A, 0x10, 0x13, 0x12, + 0x0F, 0x09, 0x02, 0xFB, 0xF5, 0xF3, 0xF2, 0xF3, 0xF6, 0xFB, 0xFF, + 0x03, 0x05, 0x07, 0x08, 0x07, 0x05, 0x03, 0x01, 0xFF, 0xFE, 0xFC, + 0xFB, 0xFB, 0xFC, 0xFC, 0xFD, 0xFE, 0xFF, 0x00, 0x01, 0x02, 0x02, + 0x01] - wait_until: condition: From 45b30d30fac5d0dd5d5d0c497b5a6227862ba105 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 26 Dec 2024 22:17:45 +0100 Subject: [PATCH 09/27] Removed reference to experimental i2s format --- ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml index 5d0dd7d..a922cbe 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml @@ -30,7 +30,7 @@ media_player: 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 + i2s_comm_fmt: msb dac_type: external mode: mono mute_pin: From d4a18dc595ae50dc5fd5f7f371b2077d1b1dbe92 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 26 Dec 2024 23:57:21 +0100 Subject: [PATCH 10/27] Play sound at volume change --- ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml index bbdacec..e416737 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml @@ -60,6 +60,14 @@ number: - speaker.volume_set: id: speaker_embedded volume: !lambda return x/100.0f; + - if: + condition: + - lambda: 'return x > 0;' + - lambda: 'return "${tone_volume_change}" != "none";' + then: + - rtttl.play: + id: rtttl_speaker + rtttl: "${tone_volume_change}" rtttl: - id: rtttl_speaker From e69873cab5dba325fb511f952e12299251333b0c Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 01:42:41 +0100 Subject: [PATCH 11/27] Create standard package --- .github/workflows/validate_esphome_beta.yml | 121 ++++++++++- .test/esphome_ard_basic.yaml | 3 +- ..._proxy.yaml => esphome_ard_ble_proxy.yaml} | 5 + .test/esphome_ard_core.yaml | 8 + .test/esphome_idf53_basic.yaml | 11 + ...roxy.yaml => esphome_idf53_ble_proxy.yaml} | 1 + .test/esphome_idf53_core.yaml | 10 + .test/esphome_idf53_media_player.yaml | 12 ++ .test/esphome_idf_basic.yaml | 9 + .test/esphome_idf_ble_proxy.yaml | 10 + .test/esphome_idf_core.yaml | 8 + .test/esphome_idf_media_player.yaml | 10 + ...Ultimate-Easy-ESPHome_addon_ble_proxy.yaml | 5 +- ...imate-Easy-ESPHome_addon_media_player.yaml | 11 +- ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml | 59 +++--- ...Ultimate-Easy-ESPHome_core_hw_buttons.yaml | 17 +- ...TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml | 67 ++----- ...X-Ultimate-Easy-ESPHome_core_hw_touch.yaml | 17 +- .../TX-Ultimate-Easy-ESPHome_standard.yaml | 72 +++++++ ...imate-Easy-ESPHome_standard_hw_audio.yaml} | 10 +- ...mate-Easy-ESPHome_standard_hw_relays.yaml} | 189 ++++++++++++------ ...e-Easy-ESPHome_standard_hw_vibration.yaml} | 33 +-- ...timate-Easy-ESPHome_standard_speaker.yaml} | 17 +- TX-Ultimate-Easy-ESPHome.yaml | 4 +- 24 files changed, 507 insertions(+), 202 deletions(-) rename .test/{esphome_idf_bluetooth_proxy.yaml => esphome_ard_ble_proxy.yaml} (60%) create mode 100644 .test/esphome_ard_core.yaml create mode 100644 .test/esphome_idf53_basic.yaml rename .test/{esphome_idf53_bluetooth_proxy.yaml => esphome_idf53_ble_proxy.yaml} (77%) create mode 100644 .test/esphome_idf53_core.yaml create mode 100644 .test/esphome_idf53_media_player.yaml create mode 100644 .test/esphome_idf_basic.yaml create mode 100644 .test/esphome_idf_ble_proxy.yaml create mode 100644 .test/esphome_idf_core.yaml create mode 100644 .test/esphome_idf_media_player.yaml create mode 100644 ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml rename ESPHome/{TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml => TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml} (83%) rename ESPHome/{TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml => TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml} (82%) rename ESPHome/{TX-Ultimate-Easy-ESPHome_core_hw_vibration.yaml => TX-Ultimate-Easy-ESPHome_standard_hw_vibration.yaml} (85%) rename ESPHome/{TX-Ultimate-Easy-ESPHome_addon_speaker.yaml => TX-Ultimate-Easy-ESPHome_standard_speaker.yaml} (91%) diff --git a/.github/workflows/validate_esphome_beta.yml b/.github/workflows/validate_esphome_beta.yml index c59f192..6367c31 100644 --- a/.github/workflows/validate_esphome_beta.yml +++ b/.github/workflows/validate_esphome_beta.yml @@ -49,36 +49,135 @@ jobs: - name: Validate YAML files run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} + - build_basic: - name: Basic + build_ard_core: + name: Core (Arduino) + needs: code_scan runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build core + - 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_idf53_core: + name: Core (IDFv5.3) + needs: code_scan + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Core (IDFv5.3) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf53_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_bluetooth_proxy_4: - name: Bluetooth Proxy (IDF) + build_idf_basic: + name: Core (IDF) + needs: build_idf_core runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build core + - name: Build Basic (IDF) uses: esphome/build-action@main with: - yaml-file: ".test/esphome_idf_bluetooth_proxy.yaml" + yaml-file: ".test/esphome_idf_basic.yaml" version: beta - build_bluetooth_proxy_53: - name: Bluetooth Proxy (IDF v5.3) + build_idf53_basic: + name: Basic (IDFv5.3) + needs: build_idf53_core runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build core + - name: Build Basic (IDFv5.3) uses: esphome/build-action@main with: - yaml-file: ".test/esphome_idf53_bluetooth_proxy.yaml" + yaml-file: ".test/esphome_idf53_basic.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_idf53_ble_proxy: + name: Bluetooth Proxy (IDFv5.3) + needs: build_idf_basic + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build BLE Proxy (IDFv5.3) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf53_ble_proxy.yaml" + version: beta + + build_idf_media_player: + name: Media Player (IDF) + needs: build_idf_basic + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Media Player (IDF) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_media_player.yaml" + version: beta + + build_idf53_media_player: + name: Media Player (IDFv5.3) + needs: build_idf_basic + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Media Player (IDFv5.3) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf53_media_player.yaml" version: beta ... diff --git a/.test/esphome_ard_basic.yaml b/.test/esphome_ard_basic.yaml index ed32a8f..91753ec 100644 --- a/.test/esphome_ard_basic.yaml +++ b/.test/esphome_ard_basic.yaml @@ -1,6 +1,7 @@ --- packages: - basic_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml # Basic package + core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml + standard_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml esp32: framework: diff --git a/.test/esphome_idf_bluetooth_proxy.yaml b/.test/esphome_ard_ble_proxy.yaml similarity index 60% rename from .test/esphome_idf_bluetooth_proxy.yaml rename to .test/esphome_ard_ble_proxy.yaml index 3e434a5..e21e328 100644 --- a/.test/esphome_idf_bluetooth_proxy.yaml +++ b/.test/esphome_ard_ble_proxy.yaml @@ -1,5 +1,10 @@ --- 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 + +esp32: + framework: + type: arduino ... diff --git a/.test/esphome_ard_core.yaml b/.test/esphome_ard_core.yaml new file mode 100644 index 0000000..bee25b3 --- /dev/null +++ b/.test/esphome_ard_core.yaml @@ -0,0 +1,8 @@ +--- +packages: + core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml + +esp32: + framework: + type: arduino +... diff --git a/.test/esphome_idf53_basic.yaml b/.test/esphome_idf53_basic.yaml new file mode 100644 index 0000000..44ebb3b --- /dev/null +++ b/.test/esphome_idf53_basic.yaml @@ -0,0 +1,11 @@ +--- +packages: + core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml + standard_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml + +esp32: + framework: + type: esp-idf + version: 5.3.1 + platform_version: 6.9.0 +... diff --git a/.test/esphome_idf53_bluetooth_proxy.yaml b/.test/esphome_idf53_ble_proxy.yaml similarity index 77% rename from .test/esphome_idf53_bluetooth_proxy.yaml rename to .test/esphome_idf53_ble_proxy.yaml index a8d3868..d4aa126 100644 --- a/.test/esphome_idf53_bluetooth_proxy.yaml +++ b/.test/esphome_idf53_ble_proxy.yaml @@ -1,6 +1,7 @@ --- 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 esp32: diff --git a/.test/esphome_idf53_core.yaml b/.test/esphome_idf53_core.yaml new file mode 100644 index 0000000..438146c --- /dev/null +++ b/.test/esphome_idf53_core.yaml @@ -0,0 +1,10 @@ +--- +packages: + core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml + +esp32: + framework: + type: esp-idf + version: 5.3.1 + platform_version: 6.9.0 +... diff --git a/.test/esphome_idf53_media_player.yaml b/.test/esphome_idf53_media_player.yaml new file mode 100644 index 0000000..c8c4414 --- /dev/null +++ b/.test/esphome_idf53_media_player.yaml @@ -0,0 +1,12 @@ +--- +packages: + core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml + standard_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml + addon_media_player: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml + +esp32: + framework: + type: esp-idf + version: 5.3.1 + platform_version: 6.9.0 +... diff --git a/.test/esphome_idf_basic.yaml b/.test/esphome_idf_basic.yaml new file mode 100644 index 0000000..9f20465 --- /dev/null +++ b/.test/esphome_idf_basic.yaml @@ -0,0 +1,9 @@ +--- +packages: + core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml + standard_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml + +esp32: + framework: + type: esp-idf +... diff --git a/.test/esphome_idf_ble_proxy.yaml b/.test/esphome_idf_ble_proxy.yaml new file mode 100644 index 0000000..3aeba92 --- /dev/null +++ b/.test/esphome_idf_ble_proxy.yaml @@ -0,0 +1,10 @@ +--- +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 + +esp32: + framework: + type: esp-idf +... diff --git a/.test/esphome_idf_core.yaml b/.test/esphome_idf_core.yaml new file mode 100644 index 0000000..3daf403 --- /dev/null +++ b/.test/esphome_idf_core.yaml @@ -0,0 +1,8 @@ +--- +packages: + core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml + +esp32: + framework: + type: esp-idf +... diff --git a/.test/esphome_idf_media_player.yaml b/.test/esphome_idf_media_player.yaml new file mode 100644 index 0000000..1c2697b --- /dev/null +++ b/.test/esphome_idf_media_player.yaml @@ -0,0 +1,10 @@ +--- +packages: + core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml + standard_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml + addon_media_player: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml + +esp32: + framework: + type: esp-idf +... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml index 9f644a8..1346efb 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml @@ -19,8 +19,9 @@ esphome: - -D TX_ULTIMATE_EASY_ADDON_BLE_PROXY script: - - id: !extend dump_config + - id: !extend dump_config_list_packages then: + - script.wait: dump_config - lambda: |- // Check for requirements #if !defined(TX_ULTIMATE_EASY_CORE) @@ -28,5 +29,5 @@ script: #endif // Identify itself - ESP_LOGCONFIG("addon_ble_proxy", "Add-on BLE Proxy installed"); + ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Add-on - BLE Proxy"); ... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml index a922cbe..d6985fb 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml @@ -12,7 +12,7 @@ #################################################################################################### --- packages: - core_hw_audio: !include TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml + standard_hw_audio: !include TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml esp32: framework: @@ -39,19 +39,20 @@ media_player: allow_other_uses: true script: - - id: !extend dump_config + - 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_CORE_HW_AUDIO) - #error "The package TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml is required." + #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("addon_media_player", "Add-on Media Player installed"); + ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Add-on - Media Player"); switch: - id: sw_speaker_amplifier diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml index c5749a7..843ca1a 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml @@ -29,11 +29,9 @@ substitutions: packages: # yamllint disable rule:colons - core_hw_buttons: !include TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml - core_hw_leds: !include TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml - core_hw_relays: !include TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml - core_hw_touch: !include TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml - core_hw_vibration: !include TX-Ultimate-Easy-ESPHome_core_hw_vibration.yaml + core_hw_buttons: !include TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml + core_hw_leds: !include TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml + core_hw_touch: !include TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml # yamllint enable rule:colons api: @@ -60,15 +58,6 @@ binary_sensor: ESP_LOGCONFIG("core", "Pending restart: No"); - script.execute: dump_config_caller -button: - - id: bt_restart - name: Restart - internal: false - platform: restart - -captive_portal: - id: ap_captive_portal - esp32: board: esp32dev # adafruit_feather_esp32_v2 # esp32dev flash_size: 8MB @@ -79,6 +68,9 @@ esphome: name: ${name} friendly_name: ${friendly_name} comment: TX Ultimate Easy + project: + name: "edwardtfn.tx_ultimate_easy" + version: ${version} platformio_options: build_flags: - -D TX_ULTIMATE_EASY_CORE @@ -113,9 +105,6 @@ globals: max_restore_data_length: 3 # initial_value: "''" -improv_serial: - id: serial_improv - logger: level: DEBUG @@ -188,9 +177,7 @@ script: ESP_LOGCONFIG("core", "Device name (HA): %s", tx_device_name->state.c_str()); ESP_LOGCONFIG("core", "Device hostname: %s", App.get_name().c_str()); - // Version information - ESP_LOGCONFIG("core", "ESPHome builder: %s", esphome_fw_version->state.c_str()); - ESP_LOGCONFIG("core", "TX Ultimate firmware version: ${version}"); + dump_config_versions->execute(); // Framework detection #ifdef USE_ARDUINO @@ -218,6 +205,25 @@ script: then: - delay: ${DUMP_CONFIG_CALLER_DELAY} - script.execute: dump_config + - script.wait: dump_config + - script.execute: dump_config_list_packages + + - id: dump_config_list_packages + mode: restart + then: + - script.wait: dump_config + - lambda: |- + ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, "Installed packages:"); + + // Identify itself + ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Core"); + + - id: dump_config_versions + mode: restart + then: + - lambda: |- + // Version information + ESP_LOGCONFIG("core", "TX Ultimate firmware version: ${version}"); - id: publish_device_info mode: restart @@ -275,12 +281,6 @@ select: tx_ultimate->set_gang_count(id(gang_count)); text_sensor: - - id: esphome_fw_version - name: ESPHome Version - platform: version - entity_category: diagnostic - internal: false - - id: tx_fw_version name: TX Ultimate Easy Firmware Version platform: template @@ -317,13 +317,6 @@ text_sensor: } return result; -time: - - id: time_source - platform: homeassistant - -web_server: - wifi: id: wifi_component - ap: ... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml index 446e344..d93d70b 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml @@ -208,11 +208,6 @@ script: - id: !extend dump_config then: - lambda: |- - // Check for requirements - #if !defined(TX_ULTIMATE_EASY_CORE) - #error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required." - #endif - // Button's actions ESP_LOGCONFIG("core_hw_buttons", "Button%s action%s:", id(gang_count_plural_suffix).c_str(), @@ -233,6 +228,18 @@ script: ? sl_button_4_action->state.c_str() : "Unknown"); + - 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 + + // Identify itself + ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Core - Hardware - Buttons"); + - id: !extend touch_on_multi_touch_release then: - script.execute: buttons_release diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml index 219e354..62579f7 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml @@ -443,64 +443,9 @@ script: light_us_right->set_internal(!id(is_us_model)); light_us_top->set_internal(!id(is_us_model)); - // LED Group Assignment: - // - For US model: gb_lights_1 = left side LEDs, gb_lights_2 = right side LEDs - // - For EU model: gb_lights_1 = bottom LEDs, gb_lights_2 = top LEDs - // Gang configurations determine which LED segments are active - switch (id(gang_count)) { - case 1: // 1 Gang - if (id(is_us_model)) { - id(gb_lights_1) = { light_us_rl_1_1_left }; - id(gb_lights_2) = { light_us_rl_1_1_right }; - } else { - id(gb_lights_1) = { light_eu_rl_1_1_bottom }; - id(gb_lights_2) = { light_eu_rl_1_1_top }; - } - break; - case 2: // 2 Gang - if (id(is_us_model)) { - id(gb_lights_1) = { light_us_rl_1_2_left, light_us_rl_2_2_left }; - id(gb_lights_2) = { light_us_rl_1_2_right, light_us_rl_2_2_right }; - } else { - id(gb_lights_1) = { light_eu_rl_1_2_bottom, light_eu_rl_2_2_bottom }; - id(gb_lights_2) = { light_eu_rl_1_2_top, light_eu_rl_2_2_top }; - } - break; - case 3: // 3 Gang - if (id(is_us_model)) { - id(gb_lights_1) = { light_us_rl_1_3_left, light_us_rl_2_3_left, light_us_rl_3_3_left }; - id(gb_lights_2) = { light_us_rl_1_3_right, light_us_rl_2_3_right, light_us_rl_3_3_right }; - } else { - id(gb_lights_1) = { light_eu_rl_1_3_bottom, light_eu_rl_2_3_bottom, light_eu_rl_3_3_bottom }; - id(gb_lights_2) = { light_eu_rl_1_3_top, light_eu_rl_2_3_top, light_eu_rl_3_3_top }; - } - break; - case 4: // 4 Gang - if (id(is_us_model)) { - id(gb_lights_1) = { light_us_rl_1_4_left, light_us_rl_2_4_left, - light_us_rl_3_4_left, light_us_rl_4_4_left }; - id(gb_lights_2) = { light_us_rl_1_4_right, light_us_rl_2_4_right, - light_us_rl_3_4_right, light_us_rl_4_4_right }; - } else { - id(gb_lights_1) = { light_eu_rl_1_4_bottom, light_eu_rl_2_4_bottom, - light_eu_rl_3_4_bottom, light_eu_rl_4_4_bottom }; - id(gb_lights_2) = { light_eu_rl_1_4_top, light_eu_rl_2_4_top, - light_eu_rl_3_4_top, light_eu_rl_4_4_top }; - } - break; - default: - ESP_LOGE("core_hw_leds", "Invalid gang count: %" PRIu8, id(gang_count)); - break; - } - - id: !extend dump_config then: - lambda: |- - // Check for requirements - #if !defined(TX_ULTIMATE_EASY_CORE) - #error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required." - #endif - // Relay's LEDs modes ESP_LOGCONFIG("core_hw_leds", "Relay%s LEDs mode%s:", id(gang_count_plural_suffix).c_str(), @@ -539,6 +484,18 @@ script: ESP_LOGCONFIG("core_hw_leds", " Sides: ${LIGHT_SIDES_RESTORE_MODE}"); ESP_LOGCONFIG("core_hw_leds", " Individual: ${LIGHT_INDIVIDUAL_RESTORE_MODE}"); + - 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 + + // Identify itself + ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Core - Hardware - LEDs"); + - id: light_set_state mode: parallel parameters: diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml index f5c0157..8da5856 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml @@ -291,11 +291,6 @@ script: - id: !extend dump_config then: - lambda: |- - // Check for requirements - #if !defined(TX_ULTIMATE_EASY_CORE) - #error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required." - #endif - // Touch panel's state if (sw_touch_panel_power->state) ESP_LOGCONFIG("core_hw_touch", "Touch panel - Power: On"); @@ -303,6 +298,18 @@ script: ESP_LOGW("core_hw_touch", "Touch panel - Power: OFF"); ESP_LOGCONFIG("core_hw_touch", "Touch event duration: %.0fms", nr_touch_duration->state); + - 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 + + // Identify itself + ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Core - Hardware - Touchpad"); + - id: touch_on_multi_touch_release mode: restart then: diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml new file mode 100644 index 0000000..0d9c0a7 --- /dev/null +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml @@ -0,0 +1,72 @@ +#################################################################################################### +##### TX Ultimate Easy for ESPHome ##### +##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy ##### +#################################################################################################### +##### Purpose: ESPHome Standard (non-essential, but recommended packages) ##### +#################################################################################################### +##### 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: + # yamllint disable rule:colons + core_hw_relays: !include TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml + core_hw_speaker: !include TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml + core_hw_vibration: !include TX-Ultimate-Easy-ESPHome_standard_hw_vibration.yaml + # yamllint enable rule:colons + +button: + - id: bt_restart + name: Restart + internal: false + platform: restart + +captive_portal: + id: ap_captive_portal + +esphome: + platformio_options: + build_flags: + - -D TX_ULTIMATE_EASY_STANDARD + +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 + + // Identify itself + ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Standard"); + + - id: !extend dump_config_versions + then: + - lambda: |- + // Version information + ESP_LOGCONFIG("standard", "ESPHome builder: %s", esphome_fw_version->state.c_str()); + +improv_serial: + id: serial_improv + +text_sensor: + - id: esphome_fw_version + name: ESPHome Version + platform: version + entity_category: diagnostic + internal: false + +time: + - id: time_source + platform: homeassistant + +web_server: + +wifi: + ap: +... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml similarity index 83% rename from ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml rename to ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml index c9a91e2..3dcabb1 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml @@ -2,7 +2,7 @@ ##### TX Ultimate Easy for ESPHome ##### ##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy ##### #################################################################################################### -##### Purpose: ESPHome - Core - I2S Audio ##### +##### Purpose: ESPHome - Standard - I2S Audio ##### #################################################################################################### ##### Author: edwardtfn - https://github.com/edwardtfn - https://buymeacoffee.com/edwardfirmo ##### #################################################################################################### @@ -14,7 +14,7 @@ esphome: platformio_options: build_flags: - - -D TX_ULTIMATE_EASY_CORE_HW_AUDIO + - -D TX_ULTIMATE_EASY_STANDARD_HW_AUDIO i2s_audio: id: if_i2s_audio @@ -22,11 +22,15 @@ i2s_audio: i2s_lrclk_pin: GPIO4 script: - - id: !extend dump_config + - 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 + + // Identify itself + ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Standard - Hardware - Audio"); ... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml similarity index 82% rename from ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml rename to ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml index 7fa0809..432994f 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml @@ -2,7 +2,7 @@ ##### TX Ultimate Easy for ESPHome ##### ##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy ##### #################################################################################################### -##### Purpose: ESPHome Core - Hardware - Relays ##### +##### Purpose: ESPHome - Standard - Hardware - Relays ##### #################################################################################################### ##### Author: edwardtfn - https://github.com/edwardtfn - https://buymeacoffee.com/edwardfirmo ##### #################################################################################################### @@ -22,13 +22,17 @@ substitutions: esphome: platformio_options: build_flags: - - -D TX_ULTIMATE_EASY_CORE_HW_RELAYS + - -D TX_ULTIMATE_EASY_STANDARD_HW_RELAYS globals: - id: boot_initialization_relays type: bool restore_value: false initial_value: 'false' + - id: boot_initialization_relays_group_assignments + type: bool + restore_value: false + initial_value: 'false' - id: boot_initialization_relays_light_modes type: bool restore_value: false @@ -440,14 +444,17 @@ script: - id: boot_initialize_relays mode: restart then: + - script.execute: boot_initialize_relays_group_assignments - script.execute: boot_initialize_relays_light_modes - script.execute: boot_initialize_relays_relay_leds - script.execute: boot_initialize_relays_relay_modes + - script.wait: boot_initialize_relays_group_assignments - script.wait: boot_initialize_relays_light_modes - script.wait: boot_initialize_relays_relay_leds - script.wait: boot_initialize_relays_relay_modes - wait_until: condition: + - lambda: return id(boot_initialization_relays_group_assignments); - lambda: return id(boot_initialization_relays_light_modes); - lambda: return id(boot_initialization_relays_relay_leds); - lambda: return id(boot_initialization_relays_relay_modes); @@ -455,6 +462,61 @@ script: id: boot_initialization_relays value: 'true' + - id: boot_initialize_relays_group_assignments + mode: restart + then: + - lambda: |- + // LED Group Assignment: + // - For US model: gb_lights_1 = left side LEDs, gb_lights_2 = right side LEDs + // - For EU model: gb_lights_1 = bottom LEDs, gb_lights_2 = top LEDs + // Gang configurations determine which LED segments are active + switch (id(gang_count)) { + case 1: // 1 Gang + if (id(is_us_model)) { + id(gb_lights_1) = { light_us_rl_1_1_left }; + id(gb_lights_2) = { light_us_rl_1_1_right }; + } else { + id(gb_lights_1) = { light_eu_rl_1_1_bottom }; + id(gb_lights_2) = { light_eu_rl_1_1_top }; + } + break; + case 2: // 2 Gang + if (id(is_us_model)) { + id(gb_lights_1) = { light_us_rl_1_2_left, light_us_rl_2_2_left }; + id(gb_lights_2) = { light_us_rl_1_2_right, light_us_rl_2_2_right }; + } else { + id(gb_lights_1) = { light_eu_rl_1_2_bottom, light_eu_rl_2_2_bottom }; + id(gb_lights_2) = { light_eu_rl_1_2_top, light_eu_rl_2_2_top }; + } + break; + case 3: // 3 Gang + if (id(is_us_model)) { + id(gb_lights_1) = { light_us_rl_1_3_left, light_us_rl_2_3_left, light_us_rl_3_3_left }; + id(gb_lights_2) = { light_us_rl_1_3_right, light_us_rl_2_3_right, light_us_rl_3_3_right }; + } else { + id(gb_lights_1) = { light_eu_rl_1_3_bottom, light_eu_rl_2_3_bottom, light_eu_rl_3_3_bottom }; + id(gb_lights_2) = { light_eu_rl_1_3_top, light_eu_rl_2_3_top, light_eu_rl_3_3_top }; + } + break; + case 4: // 4 Gang + if (id(is_us_model)) { + id(gb_lights_1) = { light_us_rl_1_4_left, light_us_rl_2_4_left, + light_us_rl_3_4_left, light_us_rl_4_4_left }; + id(gb_lights_2) = { light_us_rl_1_4_right, light_us_rl_2_4_right, + light_us_rl_3_4_right, light_us_rl_4_4_right }; + } else { + id(gb_lights_1) = { light_eu_rl_1_4_bottom, light_eu_rl_2_4_bottom, + light_eu_rl_3_4_bottom, light_eu_rl_4_4_bottom }; + id(gb_lights_2) = { light_eu_rl_1_4_top, light_eu_rl_2_4_top, + light_eu_rl_3_4_top, light_eu_rl_4_4_top }; + } + break; + default: + ESP_LOGE("standard_hw_relays", "Invalid gang count: %" PRIu8, id(gang_count)); + break; + } + id(boot_initialization_relays_group_assignments) = true; + - id: boot_initialize_relays_light_modes mode: restart then: @@ -591,13 +653,13 @@ script: std::string select_state; bool toggle_relay = false; if (api_disconnected) { - ESP_LOGW("core_hw_relays", "Toggle relays:"); - ESP_LOGW("core_hw_relays", " API state: DISCONNECTED"); - ESP_LOGW("core_hw_relays", " Button: %" PRIu8, button); + ESP_LOGW("standard_hw_relays", "Toggle relays:"); + ESP_LOGW("standard_hw_relays", " API state: DISCONNECTED"); + ESP_LOGW("standard_hw_relays", " Button: %" PRIu8, button); } else { - ESP_LOGVV("core_hw_relays", "Toggle relays:"); - ESP_LOGVV("core_hw_relays", " API state: Connected"); - ESP_LOGVV("core_hw_relays", " Button: %" PRIu8, button); + ESP_LOGVV("standard_hw_relays", "Toggle relays:"); + ESP_LOGVV("standard_hw_relays", " API state: Connected"); + ESP_LOGVV("standard_hw_relays", " Button: %" PRIu8, button); } switch (button) { case ${BUTTON_1_ID}: @@ -630,67 +692,76 @@ script: break; } if (toggle_relay) { - ESP_LOGI("core_hw_relays", "Toggle relay %" PRIu8 ": (%s)", button, select_state.c_str()); + ESP_LOGI("standard_hw_relays", "Toggle relay %" PRIu8 ": (%s)", button, select_state.c_str()); } else if (not select_state.empty()) { - ESP_LOGV("core_hw_relays", "Ignoring toggle for relay %" PRIu8 ": action is '%s'", + ESP_LOGV("standard_hw_relays", "Ignoring toggle for relay %" PRIu8 ": action is '%s'", button, select_state.c_str()); } else { - ESP_LOGE("core_hw_relays", "No button action selected for button %" PRIu8, button); + ESP_LOGE("standard_hw_relays", "No button action selected for button %" PRIu8, button); } - id: !extend dump_config then: + - lambda: |- + // 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()); + ESP_LOGCONFIG("standard_hw_relays", " Relay 1: %s", sl_relay_1_mode->has_state() + ? sl_relay_1_mode->state.c_str() + : "Unknown"); + if (id(gang_count) >= 2) + ESP_LOGCONFIG("standard_hw_relays", " Relay 2: %s", sl_relay_2_mode->has_state() + ? sl_relay_2_mode->state.c_str() + : "Unknown"); + if (id(gang_count) >= 3) + ESP_LOGCONFIG("standard_hw_relays", " Relay 3: %s", sl_relay_3_mode->has_state() + ? sl_relay_3_mode->state.c_str() + : "Unknown"); + if (id(gang_count) >= 4) + ESP_LOGCONFIG("standard_hw_relays", " Relay 4: %s", sl_relay_4_mode->has_state() + ? sl_relay_4_mode->state.c_str() + : "Unknown"); + + // 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()); + 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"); + if (id(gang_count) >= 3) + ESP_LOGCONFIG("standard_hw_relays", " Relay 3: %s", sw_relay_3->state ? "ON" : "OFF"); + if (id(gang_count) >= 4) + ESP_LOGCONFIG("standard_hw_relays", " Relay 4: %s", sw_relay_4->state ? "ON" : "OFF"); + ESP_LOGCONFIG("standard_hw_relays", "Expose Relay's LEDs to Home Assistant: %s", + YESNO(sw_expose_relays_leds_to_ha->state)); + + // Boot initialization statuses + ESP_LOGCONFIG("standard_hw_relays", "Boot initialization flags:"); + ESP_LOGCONFIG("standard_hw_relays", " Overall: %s", YESNO(id(boot_initialization_relays))); + ESP_LOGCONFIG("standard_hw_relays", " Groups: %s", + YESNO(id(boot_initialization_relays_group_assignments))); + ESP_LOGCONFIG("standard_hw_relays", " Light modes: %s", YESNO(id(boot_initialization_relays_light_modes))); + ESP_LOGCONFIG("standard_hw_relays", " Relay modes: %s", YESNO(id(boot_initialization_relays_relay_modes))); + ESP_LOGCONFIG("standard_hw_relays", " Status LEDs: %s", YESNO(id(boot_initialization_relays_relay_leds))); + + // Substitutions + ESP_LOGCONFIG("standard_hw_relays", "Restore modes:"); + ESP_LOGCONFIG("standard_hw_relays", " Relays: ${RELAY_RESTORE_MODE}"); + ESP_LOGCONFIG("standard_hw_relays", " Status LEDs: ${LIGHT_RELAYS_RESTORE_MODE}"); + + - 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 - // Relay's modes - ESP_LOGCONFIG("core_hw_relays", "Relay%s mode%s:", - id(gang_count_plural_suffix).c_str(), - id(gang_count_plural_suffix).c_str()); - ESP_LOGCONFIG("core_hw_relays", " Relay 1: %s", sl_relay_1_mode->has_state() - ? sl_relay_1_mode->state.c_str() - : "Unknown"); - if (id(gang_count) >= 2) - ESP_LOGCONFIG("core_hw_relays", " Relay 2: %s", sl_relay_2_mode->has_state() - ? sl_relay_2_mode->state.c_str() - : "Unknown"); - if (id(gang_count) >= 3) - ESP_LOGCONFIG("core_hw_relays", " Relay 3: %s", sl_relay_3_mode->has_state() - ? sl_relay_3_mode->state.c_str() - : "Unknown"); - if (id(gang_count) >= 4) - ESP_LOGCONFIG("core_hw_relays", " Relay 4: %s", sl_relay_4_mode->has_state() - ? sl_relay_4_mode->state.c_str() - : "Unknown"); - - // Relay's states - ESP_LOGCONFIG("core_hw_relays", "Relay%s state%s:", - id(gang_count_plural_suffix).c_str(), - id(gang_count_plural_suffix).c_str()); - ESP_LOGCONFIG("core_hw_relays", " Relay 1: %s", sw_relay_1->state ? "ON" : "OFF"); - if (id(gang_count) >= 2) - ESP_LOGCONFIG("core_hw_relays", " Relay 2: %s", sw_relay_2->state ? "ON" : "OFF"); - if (id(gang_count) >= 3) - ESP_LOGCONFIG("core_hw_relays", " Relay 3: %s", sw_relay_3->state ? "ON" : "OFF"); - if (id(gang_count) >= 4) - ESP_LOGCONFIG("core_hw_relays", " Relay 4: %s", sw_relay_4->state ? "ON" : "OFF"); - ESP_LOGCONFIG("core_hw_relays", "Expose Relay's LEDs to Home Assistant: %s", - YESNO(sw_expose_relays_leds_to_ha->state)); - - // Boot initialization statuses - ESP_LOGCONFIG("core_hw_relays", "Boot initialization flags:"); - ESP_LOGCONFIG("core_hw_relays", " Overall: %s", YESNO(id(boot_initialization_relays))); - ESP_LOGCONFIG("core_hw_relays", " Light modes: %s", YESNO(id(boot_initialization_relays_light_modes))); - ESP_LOGCONFIG("core_hw_relays", " Relay modes: %s", YESNO(id(boot_initialization_relays_relay_modes))); - ESP_LOGCONFIG("core_hw_relays", " Status LEDs: %s", YESNO(id(boot_initialization_relays_relay_leds))); - - // Substitutions - ESP_LOGCONFIG("core_hw_relays", "Restore modes:"); - ESP_LOGCONFIG("core_hw_relays", " Relays: ${RELAY_RESTORE_MODE}"); - ESP_LOGCONFIG("core_hw_relays", " Status LEDs: ${LIGHT_RELAYS_RESTORE_MODE}"); + // Identify itself + ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Standard - Hardware - Relays"); - id: show_relay_status mode: restart @@ -698,7 +769,7 @@ script: - script.wait: boot_initialize_relays - lambda: |- if (not id(boot_initialization_relays)) { - ESP_LOGW("core_hw_relays", "Relays not initialized yet"); + ESP_LOGW("standard_hw_relays", "Relays not initialized yet"); if (not boot_initialize_relays->is_running()) boot_initialize_relays->execute(); return; @@ -741,8 +812,8 @@ script: break; } - ESP_LOGV("core_hw_relays", "Relay %" PRIu8 " is %s", i + 1, relay_state ? "ON" : "OFF"); - ESP_LOGV("core_hw_relays", "Light Mode for Relay %" PRIu8 ": %s", i + 1, light_mode.c_str()); + ESP_LOGV("standard_hw_relays", "Relay %" PRIu8 " is %s", i + 1, relay_state ? "ON" : "OFF"); + ESP_LOGV("standard_hw_relays", "Light Mode for Relay %" PRIu8 ": %s", i + 1, light_mode.c_str()); // Use light_set_state for light updates if (relay_state) { diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_vibration.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_vibration.yaml similarity index 85% rename from ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_vibration.yaml rename to ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_vibration.yaml index 4587626..bf7205c 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_vibration.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_vibration.yaml @@ -2,7 +2,7 @@ ##### TX Ultimate Easy for ESPHome ##### ##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy ##### #################################################################################################### -##### Purpose: ESPHome Core - Hardware - Vibration system ##### +##### Purpose: ESPHome - Standard - Hardware - Vibration system ##### #################################################################################################### ##### Author: edwardtfn - https://github.com/edwardtfn - https://buymeacoffee.com/edwardfirmo ##### #################################################################################################### @@ -35,7 +35,7 @@ button: esphome: platformio_options: build_flags: - - -D TX_ULTIMATE_EASY_CORE_HW_VIBRATION + - -D TX_ULTIMATE_EASY_STANDARD_HW_VIBRATION number: - id: nr_vibrating_duration @@ -60,23 +60,30 @@ ota: script: - id: !extend dump_config then: + - lambda: |- + // Configuration + ESP_LOGCONFIG("standard_hw_vibration", "Touch - Vibration feedback: %s", + sl_touch_vibration_feedback->state.c_str()); + ESP_LOGCONFIG("standard_hw_vibration", "Vibrate duration: %.0fms", nr_vibrating_duration->state); + ESP_LOGCONFIG("standard_hw_vibration", "Vibrate max duration: ${vibration_max_duration}"); + + // State + if (bs_vibrating->state) + ESP_LOGW("standard_hw_vibration", "Vibrating now: YES"); + else + ESP_LOGCONFIG("standard_hw_vibration", "Vibrating now: No"); + + - 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 - // Configuration - ESP_LOGCONFIG("core_hw_vibration", "Touch - Vibration feedback: %s", - sl_touch_vibration_feedback->state.c_str()); - ESP_LOGCONFIG("core_hw_vibration", "Vibrate duration: %.0fms", nr_vibrating_duration->state); - ESP_LOGCONFIG("core_hw_vibration", "Vibrate max duration: ${vibration_max_duration}"); - - // State - if (bs_vibrating->state) - ESP_LOGW("core_hw_vibration", "Vibrating now: YES"); - else - ESP_LOGCONFIG("core_hw_vibration", "Vibrating now: No"); + // Identify itself + ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Standard - Hardware - Vibration"); - id: !extend touch_on_multi_touch_release then: diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_speaker.yaml similarity index 91% rename from ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml rename to ESPHome/TX-Ultimate-Easy-ESPHome_standard_speaker.yaml index e416737..800927d 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_speaker.yaml @@ -2,7 +2,7 @@ ##### TX Ultimate Easy for ESPHome ##### ##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy ##### #################################################################################################### -##### Purpose: ESPHome - Add-on - Speaker ##### +##### Purpose: ESPHome - Standard - Speaker ##### #################################################################################################### ##### Author: edwardtfn - https://github.com/edwardtfn - https://buymeacoffee.com/edwardfirmo ##### #################################################################################################### @@ -17,7 +17,7 @@ substitutions: tone_volume_change: "scale_up:d=32,o=5,b=100:c,c#,d#,e,f#,g#,a#,b" # Use "none" to disable sound packages: - core_hw_audio: !include TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml + standard_hw_audio: !include TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml api: actions: @@ -31,14 +31,14 @@ api: - lambda: |- rtttl_speaker->stop(); if (speaker_volume->state > 0) { - ESP_LOGI("api", "Play tone: '%s'", tone.c_str()); + ESP_LOGI("standard_speaker", "Play tone: '%s'", tone.c_str()); rtttl_speaker->play(tone.c_str()); } esphome: platformio_options: build_flags: - - -D TX_ULTIMATE_EASY_ADDON_SPEAKER + - -D TX_ULTIMATE_EASY_STANDARD_SPEAKER number: - id: speaker_volume @@ -74,19 +74,20 @@ rtttl: speaker: speaker_embedded script: - - id: !extend dump_config + - 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_CORE_HW_AUDIO) - #error "The package TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml is required." + #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("addon_speaker", "Add-on Speaker installed"); + ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Standard - Speaker"); - id: speaker_play_click then: diff --git a/TX-Ultimate-Easy-ESPHome.yaml b/TX-Ultimate-Easy-ESPHome.yaml index 4e1c17d..f8cff7b 100644 --- a/TX-Ultimate-Easy-ESPHome.yaml +++ b/TX-Ultimate-Easy-ESPHome.yaml @@ -19,8 +19,8 @@ packages: ref: latest # Or you can specify a version, like `ref: v2024.12.6` refresh: 5min files: - - ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml + - 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 # - ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml # Adds experimental Media Player (limited) - # - ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml # Adds basic audio speaker support ... From c73cb950eb7864dd2f7fb4140b70fc11ec958dca Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 01:48:04 +0100 Subject: [PATCH 12/27] lint --- .github/workflows/validate_esphome.yml | 121 ++++++++++++++++++-- .github/workflows/validate_esphome_beta.yml | 4 +- 2 files changed, 112 insertions(+), 13 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index 2388c43..b62e16b 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -27,36 +27,135 @@ jobs: - name: Validate YAML files run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} + - build_basic: - name: Basic + build_ard_core: + name: Core (Arduino) + needs: code_scan runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build core + - name: Build Core (Arduino) + uses: esphome/build-action@main + 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_idf53_core: + name: Core (IDFv5.3) + needs: code_scan + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Core (IDFv5.3) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf53_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_bluetooth_proxy_4: - name: Bluetooth Proxy (IDF) + build_idf_basic: + name: Core (IDF) + needs: build_idf_core runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build core + - name: Build Basic (IDF) uses: esphome/build-action@main with: - yaml-file: ".test/esphome_idf_bluetooth_proxy.yaml" + yaml-file: ".test/esphome_idf_basic.yaml" version: latest - build_bluetooth_proxy_53: - name: Bluetooth Proxy (IDF v5.3) + build_idf53_basic: + name: Basic (IDFv5.3) + needs: build_idf53_core runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build core + - name: Build Basic (IDFv5.3) uses: esphome/build-action@main with: - yaml-file: ".test/esphome_idf53_bluetooth_proxy.yaml" + yaml-file: ".test/esphome_idf53_basic.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_idf53_ble_proxy: + name: Bluetooth Proxy (IDFv5.3) + needs: build_idf53_basic + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build BLE Proxy (IDFv5.3) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf53_ble_proxy.yaml" + version: latest + + build_idf_media_player: + name: Media Player (IDF) + needs: build_idf_basic + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Media Player (IDF) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf_media_player.yaml" + version: latest + + build_idf53_media_player: + name: Media Player (IDFv5.3) + needs: build_idf53_basic + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build Media Player (IDFv5.3) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf53_media_player.yaml" version: latest ... diff --git a/.github/workflows/validate_esphome_beta.yml b/.github/workflows/validate_esphome_beta.yml index 6367c31..b23d039 100644 --- a/.github/workflows/validate_esphome_beta.yml +++ b/.github/workflows/validate_esphome_beta.yml @@ -147,7 +147,7 @@ jobs: build_idf53_ble_proxy: name: Bluetooth Proxy (IDFv5.3) - needs: build_idf_basic + needs: build_idf53_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main @@ -171,7 +171,7 @@ jobs: build_idf53_media_player: name: Media Player (IDFv5.3) - needs: build_idf_basic + needs: build_idf53_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main From ea12c1d42264bf1967e33e7c7d2e4fb8cc5d01e1 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 01:48:58 +0100 Subject: [PATCH 13/27] Lint --- ESPHome/TX-Ultimate-Easy-ESPHome_standard_speaker.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_speaker.yaml index 800927d..1302652 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_speaker.yaml @@ -62,8 +62,8 @@ number: volume: !lambda return x/100.0f; - if: condition: - - lambda: 'return x > 0;' - - lambda: 'return "${tone_volume_change}" != "none";' + - lambda: return x > 0; + - lambda: return "${tone_volume_change}" != "none"; then: - rtttl.play: id: rtttl_speaker From 7d12ddb0e5c405009bb64ab7c597529f822f3860 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 01:56:39 +0100 Subject: [PATCH 14/27] Add WiFi SSID --- .test/esphome_ard_basic.yaml | 4 ++++ .test/esphome_ard_ble_proxy.yaml | 4 ++++ .test/esphome_ard_core.yaml | 4 ++++ .test/esphome_idf53_basic.yaml | 4 ++++ .test/esphome_idf53_ble_proxy.yaml | 4 ++++ .test/esphome_idf53_core.yaml | 4 ++++ .test/esphome_idf53_media_player.yaml | 4 ++++ .test/esphome_idf_basic.yaml | 4 ++++ .test/esphome_idf_ble_proxy.yaml | 4 ++++ .test/esphome_idf_core.yaml | 4 ++++ .test/esphome_idf_media_player.yaml | 4 ++++ 11 files changed, 44 insertions(+) diff --git a/.test/esphome_ard_basic.yaml b/.test/esphome_ard_basic.yaml index 91753ec..20554a4 100644 --- a/.test/esphome_ard_basic.yaml +++ b/.test/esphome_ard_basic.yaml @@ -6,4 +6,8 @@ packages: esp32: framework: type: arduino + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password ... diff --git a/.test/esphome_ard_ble_proxy.yaml b/.test/esphome_ard_ble_proxy.yaml index e21e328..86cc07c 100644 --- a/.test/esphome_ard_ble_proxy.yaml +++ b/.test/esphome_ard_ble_proxy.yaml @@ -7,4 +7,8 @@ packages: esp32: framework: type: arduino + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password ... diff --git a/.test/esphome_ard_core.yaml b/.test/esphome_ard_core.yaml index bee25b3..1b50c90 100644 --- a/.test/esphome_ard_core.yaml +++ b/.test/esphome_ard_core.yaml @@ -5,4 +5,8 @@ packages: esp32: framework: type: arduino + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password ... diff --git a/.test/esphome_idf53_basic.yaml b/.test/esphome_idf53_basic.yaml index 44ebb3b..1dabf1f 100644 --- a/.test/esphome_idf53_basic.yaml +++ b/.test/esphome_idf53_basic.yaml @@ -8,4 +8,8 @@ esp32: type: esp-idf version: 5.3.1 platform_version: 6.9.0 + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password ... diff --git a/.test/esphome_idf53_ble_proxy.yaml b/.test/esphome_idf53_ble_proxy.yaml index d4aa126..b17b6d2 100644 --- a/.test/esphome_idf53_ble_proxy.yaml +++ b/.test/esphome_idf53_ble_proxy.yaml @@ -9,4 +9,8 @@ esp32: type: esp-idf version: 5.3.1 platform_version: 6.9.0 + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password ... diff --git a/.test/esphome_idf53_core.yaml b/.test/esphome_idf53_core.yaml index 438146c..18239c7 100644 --- a/.test/esphome_idf53_core.yaml +++ b/.test/esphome_idf53_core.yaml @@ -7,4 +7,8 @@ esp32: type: esp-idf version: 5.3.1 platform_version: 6.9.0 + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password ... diff --git a/.test/esphome_idf53_media_player.yaml b/.test/esphome_idf53_media_player.yaml index c8c4414..fdc7e14 100644 --- a/.test/esphome_idf53_media_player.yaml +++ b/.test/esphome_idf53_media_player.yaml @@ -9,4 +9,8 @@ esp32: type: esp-idf version: 5.3.1 platform_version: 6.9.0 + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password ... diff --git a/.test/esphome_idf_basic.yaml b/.test/esphome_idf_basic.yaml index 9f20465..ab3d202 100644 --- a/.test/esphome_idf_basic.yaml +++ b/.test/esphome_idf_basic.yaml @@ -6,4 +6,8 @@ packages: esp32: framework: type: esp-idf + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password ... diff --git a/.test/esphome_idf_ble_proxy.yaml b/.test/esphome_idf_ble_proxy.yaml index 3aeba92..c972d0f 100644 --- a/.test/esphome_idf_ble_proxy.yaml +++ b/.test/esphome_idf_ble_proxy.yaml @@ -7,4 +7,8 @@ packages: esp32: framework: type: esp-idf + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password ... diff --git a/.test/esphome_idf_core.yaml b/.test/esphome_idf_core.yaml index 3daf403..846889a 100644 --- a/.test/esphome_idf_core.yaml +++ b/.test/esphome_idf_core.yaml @@ -5,4 +5,8 @@ packages: esp32: framework: type: esp-idf + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password ... diff --git a/.test/esphome_idf_media_player.yaml b/.test/esphome_idf_media_player.yaml index 1c2697b..7f94d6e 100644 --- a/.test/esphome_idf_media_player.yaml +++ b/.test/esphome_idf_media_player.yaml @@ -7,4 +7,8 @@ packages: esp32: framework: type: esp-idf + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password ... From 3d21c2ebcb8e8efed293fc004325295540dd08a4 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 02:02:01 +0100 Subject: [PATCH 15/27] Add cinttypes --- components/tx_ultimate_easy/tx_ultimate_easy.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/components/tx_ultimate_easy/tx_ultimate_easy.cpp b/components/tx_ultimate_easy/tx_ultimate_easy.cpp index 640f3db..d3de82b 100644 --- a/components/tx_ultimate_easy/tx_ultimate_easy.cpp +++ b/components/tx_ultimate_easy/tx_ultimate_easy.cpp @@ -2,6 +2,7 @@ #include "esphome/core/log.h" #include "tx_ultimate_easy.h" +#include #include namespace esphome { From 6221e109e8b33a0f08068c10d3f5fa6db8a5a922 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 02:08:11 +0100 Subject: [PATCH 16/27] Rename speaker file --- ...r.yaml => TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename ESPHome/{TX-Ultimate-Easy-ESPHome_standard_speaker.yaml => TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml} (98%) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml similarity index 98% rename from ESPHome/TX-Ultimate-Easy-ESPHome_standard_speaker.yaml rename to ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml index 1302652..3492af8 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml @@ -87,7 +87,7 @@ script: #endif // Identify itself - ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Standard - Speaker"); + ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Standard - Hardware - Speaker"); - id: speaker_play_click then: From 9828b6ff8a8b8110cb833a35724eb69b923a90e7 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 02:15:51 +0100 Subject: [PATCH 17/27] Add tests core+hw_relays --- .github/workflows/validate_esphome_beta.yml | 54 +++++++++++++++++---- .test/esphome_ard_hw_relays.yaml | 13 +++++ .test/esphome_idf53_hw_relays.yaml | 15 ++++++ .test/esphome_idf_hw_relays.yaml | 13 +++++ 4 files changed, 86 insertions(+), 9 deletions(-) create mode 100644 .test/esphome_ard_hw_relays.yaml create mode 100644 .test/esphome_idf53_hw_relays.yaml create mode 100644 .test/esphome_idf_hw_relays.yaml diff --git a/.github/workflows/validate_esphome_beta.yml b/.github/workflows/validate_esphome_beta.yml index b23d039..777b427 100644 --- a/.github/workflows/validate_esphome_beta.yml +++ b/.github/workflows/validate_esphome_beta.yml @@ -74,12 +74,12 @@ jobs: version: beta build_idf53_core: - name: Core (IDFv5.3) + name: Core (IDF v5.3) needs: code_scan runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build Core (IDFv5.3) + - name: Build Core (IDF v5.3) uses: esphome/build-action@main with: yaml-file: ".test/esphome_idf53_core.yaml" @@ -98,7 +98,7 @@ jobs: version: beta build_idf_basic: - name: Core (IDF) + name: Basic (IDF) needs: build_idf_core runs-on: ubuntu-latest steps: @@ -110,17 +110,53 @@ jobs: version: beta build_idf53_basic: - name: Basic (IDFv5.3) + name: Basic (IDF v5.3) needs: build_idf53_core runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build Basic (IDFv5.3) + - name: Build Basic (IDF v5.3) uses: esphome/build-action@main with: yaml-file: ".test/esphome_idf53_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_idf53_hw_relays: + name: HW Relays (IDF v5.3) + needs: build_idf53_core + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build HW Relays (IDF v5.3) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf53_hw_relays.yaml" + version: beta + build_ard_ble_proxy: name: Bluetooth Proxy (Ard) needs: build_ard_basic @@ -146,12 +182,12 @@ jobs: version: beta build_idf53_ble_proxy: - name: Bluetooth Proxy (IDFv5.3) + name: Bluetooth Proxy (IDF v5.3) needs: build_idf53_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build BLE Proxy (IDFv5.3) + - name: Build BLE Proxy (IDF v5.3) uses: esphome/build-action@main with: yaml-file: ".test/esphome_idf53_ble_proxy.yaml" @@ -170,12 +206,12 @@ jobs: version: beta build_idf53_media_player: - name: Media Player (IDFv5.3) + name: Media Player (IDF v5.3) needs: build_idf53_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build Media Player (IDFv5.3) + - name: Build Media Player (IDF v5.3) uses: esphome/build-action@main with: yaml-file: ".test/esphome_idf53_media_player.yaml" diff --git a/.test/esphome_ard_hw_relays.yaml b/.test/esphome_ard_hw_relays.yaml new file mode 100644 index 0000000..704ac7d --- /dev/null +++ b/.test/esphome_ard_hw_relays.yaml @@ -0,0 +1,13 @@ +--- +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 + +esp32: + framework: + type: arduino + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password +... diff --git a/.test/esphome_idf53_hw_relays.yaml b/.test/esphome_idf53_hw_relays.yaml new file mode 100644 index 0000000..d9f5bd0 --- /dev/null +++ b/.test/esphome_idf53_hw_relays.yaml @@ -0,0 +1,15 @@ +--- +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 + +esp32: + framework: + type: esp-idf + version: 5.3.1 + platform_version: 6.9.0 + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password +... diff --git a/.test/esphome_idf_hw_relays.yaml b/.test/esphome_idf_hw_relays.yaml new file mode 100644 index 0000000..d78b1b4 --- /dev/null +++ b/.test/esphome_idf_hw_relays.yaml @@ -0,0 +1,13 @@ +--- +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 + +esp32: + framework: + type: esp-idf + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password +... From 0c9a5ac65e79bc569d7baa975626ae6908fe3490 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 02:19:59 +0100 Subject: [PATCH 18/27] Rebuild tone_volume_change play on volume change IDF v5.3 compatibility --- ...X-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml index 3492af8..a457d99 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml @@ -60,14 +60,11 @@ number: - speaker.volume_set: id: speaker_embedded volume: !lambda return x/100.0f; - - if: - condition: - - lambda: return x > 0; - - lambda: return "${tone_volume_change}" != "none"; - then: - - rtttl.play: - id: rtttl_speaker - rtttl: "${tone_volume_change}" + - lambda: |- + static const std::string tone_volume_change = "${tone_volume_change}"; + // Play sound if tone_volume_change is not "none" + if (x > 0 and !tone_volume_change.empty() and tone_volume_change != "none") + rtttl_speaker->play(tone_volume_change); rtttl: - id: rtttl_speaker From 2811eedffb18867d36141d234f18405ed9465a80 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 02:23:24 +0100 Subject: [PATCH 19/27] Bump version --- versioning/VERSION | 2 +- versioning/VERSION_YAML | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/versioning/VERSION b/versioning/VERSION index 035e90a..9ec75a4 100644 --- a/versioning/VERSION +++ b/versioning/VERSION @@ -1 +1 @@ -2024.12.19 +2024.12.21 \ No newline at end of file diff --git a/versioning/VERSION_YAML b/versioning/VERSION_YAML index 5803b9d..f338ed0 100644 --- a/versioning/VERSION_YAML +++ b/versioning/VERSION_YAML @@ -1 +1 @@ -version: 2024.12.19 +version: 2024.12.21 \ No newline at end of file From fa516a66cc7d5c488ecfe3b72309a38ee6f41bf4 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 02:27:48 +0100 Subject: [PATCH 20/27] Add HW Speaker tests --- .github/workflows/validate_esphome_beta.yml | 36 +++++++++++++++++++++ .test/esphome_ard_hw_speaker.yaml | 13 ++++++++ .test/esphome_idf53_hw_speaker.yaml | 15 +++++++++ .test/esphome_idf_hw_speaker.yaml | 13 ++++++++ 4 files changed, 77 insertions(+) create mode 100644 .test/esphome_ard_hw_speaker.yaml create mode 100644 .test/esphome_idf53_hw_speaker.yaml create mode 100644 .test/esphome_idf_hw_speaker.yaml diff --git a/.github/workflows/validate_esphome_beta.yml b/.github/workflows/validate_esphome_beta.yml index 777b427..e25e096 100644 --- a/.github/workflows/validate_esphome_beta.yml +++ b/.github/workflows/validate_esphome_beta.yml @@ -157,6 +157,42 @@ jobs: yaml-file: ".test/esphome_idf53_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_idf53_hw_speaker: + name: HW Speaker (IDF v5.3) + needs: build_idf53_core + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build HW Speaker (IDF v5.3) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf53_hw_speaker.yaml" + version: beta + build_ard_ble_proxy: name: Bluetooth Proxy (Ard) needs: build_ard_basic diff --git a/.test/esphome_ard_hw_speaker.yaml b/.test/esphome_ard_hw_speaker.yaml new file mode 100644 index 0000000..62272ca --- /dev/null +++ b/.test/esphome_ard_hw_speaker.yaml @@ -0,0 +1,13 @@ +--- +packages: + core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml + standard_hw_speaker_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml + +esp32: + framework: + type: arduino + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password +... diff --git a/.test/esphome_idf53_hw_speaker.yaml b/.test/esphome_idf53_hw_speaker.yaml new file mode 100644 index 0000000..651ac37 --- /dev/null +++ b/.test/esphome_idf53_hw_speaker.yaml @@ -0,0 +1,15 @@ +--- +packages: + core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml + standard_hw_speaker_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml + +esp32: + framework: + type: esp-idf + version: 5.3.1 + platform_version: 6.9.0 + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password +... diff --git a/.test/esphome_idf_hw_speaker.yaml b/.test/esphome_idf_hw_speaker.yaml new file mode 100644 index 0000000..8bcf3ff --- /dev/null +++ b/.test/esphome_idf_hw_speaker.yaml @@ -0,0 +1,13 @@ +--- +packages: + core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml + standard_hw_speaker_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml + +esp32: + framework: + type: esp-idf + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password +... From 9d0fcf6bfa7458d352c3d11ad7a237d05ed08e0a Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 02:30:52 +0100 Subject: [PATCH 21/27] Test Media Player with Arduino --- .github/workflows/validate_esphome_beta.yml | 10 +++++----- ...player.yaml => esphome_ard_media_player.yaml} | 2 +- .test/esphome_idf53_media_player.yaml | 16 ---------------- 3 files changed, 6 insertions(+), 22 deletions(-) rename .test/{esphome_idf_media_player.yaml => esphome_ard_media_player.yaml} (95%) delete mode 100644 .test/esphome_idf53_media_player.yaml diff --git a/.github/workflows/validate_esphome_beta.yml b/.github/workflows/validate_esphome_beta.yml index e25e096..43f2859 100644 --- a/.github/workflows/validate_esphome_beta.yml +++ b/.github/workflows/validate_esphome_beta.yml @@ -229,16 +229,16 @@ jobs: yaml-file: ".test/esphome_idf53_ble_proxy.yaml" version: beta - build_idf_media_player: - name: Media Player (IDF) - needs: build_idf_basic + build_ard_media_player: + name: Media Player (Ard) + needs: build_ard_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build Media Player (IDF) + - name: Build Media Player (Ard) uses: esphome/build-action@main with: - yaml-file: ".test/esphome_idf_media_player.yaml" + yaml-file: ".test/esphome_ard_media_player.yaml" version: beta build_idf53_media_player: diff --git a/.test/esphome_idf_media_player.yaml b/.test/esphome_ard_media_player.yaml similarity index 95% rename from .test/esphome_idf_media_player.yaml rename to .test/esphome_ard_media_player.yaml index 7f94d6e..9c1dc40 100644 --- a/.test/esphome_idf_media_player.yaml +++ b/.test/esphome_ard_media_player.yaml @@ -6,7 +6,7 @@ packages: esp32: framework: - type: esp-idf + type: arduino wifi: ssid: !secret wifi_ssid diff --git a/.test/esphome_idf53_media_player.yaml b/.test/esphome_idf53_media_player.yaml deleted file mode 100644 index fdc7e14..0000000 --- a/.test/esphome_idf53_media_player.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -packages: - core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml - standard_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml - addon_media_player: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_addon_media_player.yaml - -esp32: - framework: - type: esp-idf - version: 5.3.1 - platform_version: 6.9.0 - -wifi: - ssid: !secret wifi_ssid - password: !secret wifi_password -... From b69bc6916b5cd86eef90639288bf2dd4e016888f Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 02:33:52 +0100 Subject: [PATCH 22/27] Comments only --- 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 a457d99..e9d5c3b 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml @@ -2,7 +2,7 @@ ##### TX Ultimate Easy for ESPHome ##### ##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy ##### #################################################################################################### -##### Purpose: ESPHome - Standard - Speaker ##### +##### Purpose: ESPHome - Standard - Hardware - Speaker ##### #################################################################################################### ##### Author: edwardtfn - https://github.com/edwardtfn - https://buymeacoffee.com/edwardfirmo ##### #################################################################################################### From f154a483cc553f0c04efae85d834d38386bcee64 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 02:36:47 +0100 Subject: [PATCH 23/27] Run tests when test script changes --- .github/workflows/validate_esphome_beta.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/validate_esphome_beta.yml b/.github/workflows/validate_esphome_beta.yml index 43f2859..edf453f 100644 --- a/.github/workflows/validate_esphome_beta.yml +++ b/.github/workflows/validate_esphome_beta.yml @@ -4,22 +4,26 @@ name: Validate ESPHome (Beta) on: # yamllint disable-line rule:truthy push: paths: - - "*.yaml" - - "ESPHome/*.yaml" - - ".test/*.yaml" - - "*.h" - "*.c" - "*.cpp" + - "*.h" - "*.py" + - "*.yaml" + - ".github/workflows/*.*" + - ".test/*.*" + - "components/*.*" + - "components/tx_ultimate_easy/*.*" + - "ESPHome/*.*" branches: - main pull_request: paths: - - "*.yaml" - - "*.h" - "*.c" - "*.cpp" + - "*.h" - "*.py" + - "*.yaml" + - ".github/workflows/*.*" - ".test/*.*" - "components/*.*" - "components/tx_ultimate_easy/*.*" From 3401aaf4a3155855c909303bd0d8d98fe27cb35b Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 02:42:36 +0100 Subject: [PATCH 24/27] Add tests with hw_vibration --- .github/workflows/validate_esphome.yml | 136 ++++++++++++++++++-- .github/workflows/validate_esphome_beta.yml | 36 ++++++ .test/esphome_ard_hw_vibration.yaml | 13 ++ .test/esphome_idf53_hw_vibration.yaml | 15 +++ .test/esphome_idf_hw_vibration.yaml | 13 ++ 5 files changed, 199 insertions(+), 14 deletions(-) create mode 100644 .test/esphome_ard_hw_vibration.yaml create mode 100644 .test/esphome_idf53_hw_vibration.yaml create mode 100644 .test/esphome_idf_hw_vibration.yaml diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index b62e16b..cdcfed9 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -52,12 +52,12 @@ jobs: version: latest build_idf53_core: - name: Core (IDFv5.3) + name: Core (IDF v5.3) needs: code_scan runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build Core (IDFv5.3) + - name: Build Core (IDF v5.3) uses: esphome/build-action@main with: yaml-file: ".test/esphome_idf53_core.yaml" @@ -76,7 +76,7 @@ jobs: version: latest build_idf_basic: - name: Core (IDF) + name: Basic (IDF) needs: build_idf_core runs-on: ubuntu-latest steps: @@ -88,17 +88,125 @@ jobs: version: latest build_idf53_basic: - name: Basic (IDFv5.3) + name: Basic (IDF v5.3) needs: build_idf53_core runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build Basic (IDFv5.3) + - name: Build Basic (IDF v5.3) uses: esphome/build-action@main with: yaml-file: ".test/esphome_idf53_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_idf53_hw_relays: + name: HW Relays (IDF v5.3) + needs: build_idf53_core + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build HW Relays (IDF v5.3) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf53_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_idf53_hw_speaker: + name: HW Speaker (IDF v5.3) + needs: build_idf53_core + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build HW Speaker (IDF v5.3) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf53_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_idf53_hw_vibration: + name: HW Vibration (IDF v5.3) + needs: build_idf53_core + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build HW Vibration (IDF v5.3) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf53_hw_vibration.yaml" + version: latest + build_ard_ble_proxy: name: Bluetooth Proxy (Ard) needs: build_ard_basic @@ -124,36 +232,36 @@ jobs: version: latest build_idf53_ble_proxy: - name: Bluetooth Proxy (IDFv5.3) + name: Bluetooth Proxy (IDF v5.3) needs: build_idf53_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build BLE Proxy (IDFv5.3) + - name: Build BLE Proxy (IDF v5.3) uses: esphome/build-action@main with: yaml-file: ".test/esphome_idf53_ble_proxy.yaml" version: latest - build_idf_media_player: - name: Media Player (IDF) - needs: build_idf_basic + build_ard_media_player: + name: Media Player (Ard) + needs: build_ard_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build Media Player (IDF) + - name: Build Media Player (Ard) uses: esphome/build-action@main with: - yaml-file: ".test/esphome_idf_media_player.yaml" + yaml-file: ".test/esphome_ard_media_player.yaml" version: latest build_idf53_media_player: - name: Media Player (IDFv5.3) + name: Media Player (IDF v5.3) needs: build_idf53_basic runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build Media Player (IDFv5.3) + - name: Build Media Player (IDF v5.3) uses: esphome/build-action@main with: yaml-file: ".test/esphome_idf53_media_player.yaml" diff --git a/.github/workflows/validate_esphome_beta.yml b/.github/workflows/validate_esphome_beta.yml index edf453f..bd03601 100644 --- a/.github/workflows/validate_esphome_beta.yml +++ b/.github/workflows/validate_esphome_beta.yml @@ -197,6 +197,42 @@ jobs: yaml-file: ".test/esphome_idf53_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_idf53_hw_vibration: + name: HW Vibration (IDF v5.3) + needs: build_idf53_core + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build HW Vibration (IDF v5.3) + uses: esphome/build-action@main + with: + yaml-file: ".test/esphome_idf53_hw_vibration.yaml" + version: beta + build_ard_ble_proxy: name: Bluetooth Proxy (Ard) needs: build_ard_basic diff --git a/.test/esphome_ard_hw_vibration.yaml b/.test/esphome_ard_hw_vibration.yaml new file mode 100644 index 0000000..5dbacea --- /dev/null +++ b/.test/esphome_ard_hw_vibration.yaml @@ -0,0 +1,13 @@ +--- +packages: + core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml + standard_hw_vibration_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_vibration.yaml + +esp32: + framework: + type: arduino + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password +... diff --git a/.test/esphome_idf53_hw_vibration.yaml b/.test/esphome_idf53_hw_vibration.yaml new file mode 100644 index 0000000..d0a5ed3 --- /dev/null +++ b/.test/esphome_idf53_hw_vibration.yaml @@ -0,0 +1,15 @@ +--- +packages: + core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml + standard_hw_vibration_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_vibration.yaml + +esp32: + framework: + type: esp-idf + version: 5.3.1 + platform_version: 6.9.0 + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password +... diff --git a/.test/esphome_idf_hw_vibration.yaml b/.test/esphome_idf_hw_vibration.yaml new file mode 100644 index 0000000..8ac9039 --- /dev/null +++ b/.test/esphome_idf_hw_vibration.yaml @@ -0,0 +1,13 @@ +--- +packages: + core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml + standard_hw_vibration_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_vibration.yaml + +esp32: + framework: + type: esp-idf + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password +... From 02c7c1aff1031339217bc255cd36066bcdfe2ee2 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 02:47:00 +0100 Subject: [PATCH 25/27] Remove media player test with idf 5.3 --- .github/workflows/validate_esphome.yml | 12 ------------ .github/workflows/validate_esphome_beta.yml | 12 ------------ 2 files changed, 24 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index cdcfed9..114fe38 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -254,16 +254,4 @@ jobs: with: yaml-file: ".test/esphome_ard_media_player.yaml" version: latest - - build_idf53_media_player: - name: Media Player (IDF v5.3) - needs: build_idf53_basic - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Media Player (IDF v5.3) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf53_media_player.yaml" - version: latest ... diff --git a/.github/workflows/validate_esphome_beta.yml b/.github/workflows/validate_esphome_beta.yml index bd03601..6ed9cfd 100644 --- a/.github/workflows/validate_esphome_beta.yml +++ b/.github/workflows/validate_esphome_beta.yml @@ -280,16 +280,4 @@ jobs: with: yaml-file: ".test/esphome_ard_media_player.yaml" version: beta - - build_idf53_media_player: - name: Media Player (IDF v5.3) - needs: build_idf53_basic - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Media Player (IDF v5.3) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf53_media_player.yaml" - version: beta ... From 088213137f228670c80acd8332e1967c90430e80 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 02:55:27 +0100 Subject: [PATCH 26/27] Do not try media player and speaker together --- .github/workflows/validate_esphome.yml | 5 ++++- .github/workflows/validate_esphome_beta.yml | 5 ++++- .test/esphome_ard_media_player.yaml | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index 114fe38..70cca04 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -245,7 +245,10 @@ jobs: build_ard_media_player: name: Media Player (Ard) - needs: build_ard_basic + needs: + - build_ard_basic + - build_ard_hw_relays + - build_ard_hw_vibration runs-on: ubuntu-latest steps: - uses: actions/checkout@main diff --git a/.github/workflows/validate_esphome_beta.yml b/.github/workflows/validate_esphome_beta.yml index 6ed9cfd..fa0c57d 100644 --- a/.github/workflows/validate_esphome_beta.yml +++ b/.github/workflows/validate_esphome_beta.yml @@ -271,7 +271,10 @@ jobs: build_ard_media_player: name: Media Player (Ard) - needs: build_ard_basic + needs: + - build_ard_basic + - build_ard_hw_relays + - build_ard_hw_vibration runs-on: ubuntu-latest steps: - uses: actions/checkout@main diff --git a/.test/esphome_ard_media_player.yaml b/.test/esphome_ard_media_player.yaml index 9c1dc40..9a9f744 100644 --- a/.test/esphome_ard_media_player.yaml +++ b/.test/esphome_ard_media_player.yaml @@ -1,7 +1,8 @@ --- packages: core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml - standard_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard.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 esp32: From fee446c5e268f83dc48bb7119bd4d049b5e3d2ce Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Fri, 27 Dec 2024 03:12:29 +0100 Subject: [PATCH 27/27] Specify permissions and trigger's files types --- .github/workflows/validate_esphome.yml | 4 +++ .github/workflows/validate_esphome_beta.yml | 36 +++++++++------------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index 70cca04..a516df5 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -1,6 +1,10 @@ --- name: Validate ESPHome (Latest) +permissions: + contents: read + pull-requests: read + on: # yamllint disable-line rule:truthy workflow_dispatch: diff --git a/.github/workflows/validate_esphome_beta.yml b/.github/workflows/validate_esphome_beta.yml index fa0c57d..9cd663d 100644 --- a/.github/workflows/validate_esphome_beta.yml +++ b/.github/workflows/validate_esphome_beta.yml @@ -1,33 +1,29 @@ --- name: Validate ESPHome (Beta) +permissions: + contents: read + pull-requests: read + on: # yamllint disable-line rule:truthy push: paths: - - "*.c" - - "*.cpp" - - "*.h" - - "*.py" - - "*.yaml" - - ".github/workflows/*.*" - - ".test/*.*" - - "components/*.*" - - "components/tx_ultimate_easy/*.*" - - "ESPHome/*.*" + - "*.{yml,yaml,h,cpp,c,py}" + - ".github/workflows/*.{yml,yaml,h,cpp,c,py}" + - ".test/*.{yml,yaml,h,cpp,c,py}" + - "components/*.{yml,yaml,h,cpp,c,py}" + - "components/tx_ultimate_easy/*.{yml,yaml,h,cpp,c,py}" + - "ESPHome/*.{yml,yaml,h,cpp,c,py}" branches: - main pull_request: paths: - - "*.c" - - "*.cpp" - - "*.h" - - "*.py" - - "*.yaml" - - ".github/workflows/*.*" - - ".test/*.*" - - "components/*.*" - - "components/tx_ultimate_easy/*.*" - - "ESPHome/*.*" + - "*.{yml,yaml,h,cpp,c,py}" + - ".github/workflows/*.{yml,yaml,h,cpp,c,py}" + - ".test/*.{yml,yaml,h,cpp,c,py}" + - "components/*.{yml,yaml,h,cpp,c,py}" + - "components/tx_ultimate_easy/*.{yml,yaml,h,cpp,c,py}" + - "ESPHome/*.{yml,yaml,h,cpp,c,py}" workflow_dispatch: concurrency: