diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml index a516df5..444fa08 100644 --- a/.github/workflows/validate_esphome.yml +++ b/.github/workflows/validate_esphome.yml @@ -55,18 +55,6 @@ jobs: yaml-file: ".test/esphome_idf_core.yaml" version: latest - build_idf53_core: - name: Core (IDF v5.3) - needs: code_scan - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Core (IDF v5.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 @@ -91,18 +79,6 @@ jobs: yaml-file: ".test/esphome_idf_basic.yaml" version: latest - build_idf53_basic: - name: Basic (IDF v5.3) - needs: build_idf53_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - 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 @@ -127,18 +103,6 @@ jobs: 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 @@ -163,18 +127,6 @@ jobs: 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 @@ -199,18 +151,6 @@ jobs: 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 @@ -235,18 +175,6 @@ jobs: yaml-file: ".test/esphome_idf_ble_proxy.yaml" version: latest - build_idf53_ble_proxy: - name: Bluetooth Proxy (IDF v5.3) - needs: build_idf53_basic - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build BLE Proxy (IDF v5.3) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf53_ble_proxy.yaml" - version: latest - build_ard_media_player: name: Media Player (Ard) needs: diff --git a/.github/workflows/validate_esphome_beta.yml b/.github/workflows/validate_esphome_beta.yml index dedada4..970b307 100644 --- a/.github/workflows/validate_esphome_beta.yml +++ b/.github/workflows/validate_esphome_beta.yml @@ -73,18 +73,6 @@ jobs: yaml-file: ".test/esphome_idf_core.yaml" version: beta - build_idf53_core: - name: Core (IDF v5.3) - needs: code_scan - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build Core (IDF v5.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 @@ -109,18 +97,6 @@ jobs: yaml-file: ".test/esphome_idf_basic.yaml" version: beta - build_idf53_basic: - name: Basic (IDF v5.3) - needs: build_idf53_core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - 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 @@ -145,18 +121,6 @@ jobs: 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_hw_speaker: name: HW Speaker (Arduino) needs: build_ard_core @@ -181,18 +145,6 @@ jobs: 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_hw_vibration: name: HW Vibration (Arduino) needs: build_ard_core @@ -217,18 +169,6 @@ jobs: 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 @@ -253,18 +193,6 @@ jobs: yaml-file: ".test/esphome_idf_ble_proxy.yaml" version: beta - build_idf53_ble_proxy: - name: Bluetooth Proxy (IDF v5.3) - needs: build_idf53_basic - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - - name: Build BLE Proxy (IDF v5.3) - uses: esphome/build-action@main - with: - yaml-file: ".test/esphome_idf53_ble_proxy.yaml" - version: beta - build_ard_media_player: name: Media Player (Ard) needs: diff --git a/.test/esphome_idf53_basic.yaml b/.test/esphome_idf53_basic.yaml deleted file mode 100644 index 10024d4..0000000 --- a/.test/esphome_idf53_basic.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -packages: - common_idf53: !include common_idf53.yaml - core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml - standard_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml - -media_player: !remove - -switch: - - id: !remove sw_speaker_amplifier -... diff --git a/.test/esphome_idf53_ble_proxy.yaml b/.test/esphome_idf53_ble_proxy.yaml deleted file mode 100644 index 5acf57b..0000000 --- a/.test/esphome_idf53_ble_proxy.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -packages: - common: !include common.yaml - core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml - standard_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml - addon_bluetooth_proxy: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml - -esp32: - framework: - type: esp-idf - version: 5.3.1 - platform_version: 6.9.0 -... diff --git a/.test/esphome_idf53_core.yaml b/.test/esphome_idf53_core.yaml deleted file mode 100644 index 82b38fc..0000000 --- a/.test/esphome_idf53_core.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -packages: - common_idf53: !include common_idf53.yaml - core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml -... diff --git a/.test/esphome_idf53_hw_relays.yaml b/.test/esphome_idf53_hw_relays.yaml deleted file mode 100644 index 628bb79..0000000 --- a/.test/esphome_idf53_hw_relays.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -packages: - common_idf53: !include common_idf53.yaml - core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml - standard_hw_relays_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_relays.yaml -... diff --git a/.test/esphome_idf53_hw_speaker.yaml b/.test/esphome_idf53_hw_speaker.yaml deleted file mode 100644 index 4b4581f..0000000 --- a/.test/esphome_idf53_hw_speaker.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -packages: - common_idf53: !include common_idf53.yaml - core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml - standard_hw_speaker_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_speaker.yaml -... diff --git a/.test/esphome_idf53_hw_vibration.yaml b/.test/esphome_idf53_hw_vibration.yaml deleted file mode 100644 index 1bc90ad..0000000 --- a/.test/esphome_idf53_hw_vibration.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -packages: - common_idf53: !include common_idf53.yaml - core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml - standard_hw_vibration_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_standard_hw_vibration.yaml -... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_common.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_common.yaml index dc41971..dfd7cbf 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_common.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_common.yaml @@ -17,6 +17,8 @@ substitutions: <<: !include ../versioning/VERSION_YAML + EVENT_NAME: esphome.tx_ultimate_easy + TX_MODEL_FORMAT_EU_TEXT: "EU (Square, T5-xC-86)" TX_MODEL_FORMAT_US_TEXT: "US (Rectangle, T5-xC-120)" @@ -116,13 +118,15 @@ script: parameters: type: string then: - - homeassistant.event: - event: esphome.tx_ultimate_easy - data: - device_name: !lambda return tx_device_name->state.c_str(); - firmware: ${version} - domain: boot - type: !lambda return type.c_str(); + - lambda: |- + // Send event to Home Assistant + esphome::api::CustomAPIDevice ha_event; + ha_event.fire_homeassistant_event("${EVENT_NAME}", { + {"device_name", id(tx_device_name).state.c_str()}, + {"firmware", "${version}"}, + {"domain", "boot"}, + {"type", type.c_str()} + }); - id: boot_done mode: restart diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml index d93d70b..e5c914d 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_buttons.yaml @@ -112,18 +112,19 @@ script: action: string count: uint8_t then: - - homeassistant.event: - event: esphome.tx_ultimate_easy - data: - device_name: !lambda return tx_device_name->state.c_str(); - firmware: ${version} - domain: touch - type: button - action: !lambda return action.c_str(); - button_id: !lambda return button; - count: !lambda return count; - position: !lambda return id(button_press_position); - lambda: |- + // Send event to Home Assistant + esphome::api::CustomAPIDevice ha_event; + ha_event.fire_homeassistant_event("${EVENT_NAME}", { + {"device_name", id(tx_device_name).state.c_str()}, + {"firmware", "${version}"}, + {"domain", "touch"}, + {"type", "button"}, + {"action", action.c_str()}, + {"button_id", std::to_string(button)}, + {"count", std::to_string(count)}, + {"position", std::to_string(id(button_press_position))} + }); ESP_LOGI("core_hw_buttons", "Button %" PRIu8 " action: '%s'", button, action.c_str()); if (action == "click") { switch (button) { diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml index 76e3bf6..48c8f34 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml @@ -57,7 +57,7 @@ light: # Those lights are available based on the model selections - &light_partition_with_effects id: light_eu - name: Light + name: Light EU platform: partition default_transition_length: ${default_transition_length} internal: true @@ -106,7 +106,7 @@ light: to: 27 - id: light_us - name: Light + name: Light US <<: *light_partition_with_effects segments: - id: light_full @@ -115,7 +115,7 @@ light: - &light_partition_with_effects_disabled id: light_eu_bottom - name: Light - Bottom + name: Light - Bottom EU disabled_by_default: true <<: *light_partition_with_effects segments: @@ -124,7 +124,7 @@ light: to: 12 reversed: true - id: light_eu_left - name: Light - Left + name: Light - Left EU <<: *light_partition_with_effects_disabled segments: - id: light_full @@ -132,7 +132,7 @@ light: to: 19 reversed: true - id: light_eu_right - name: Light - Right + name: Light - Right EU <<: *light_partition_with_effects_disabled segments: - id: light_full @@ -144,7 +144,7 @@ light: to: 5 reversed: false - id: light_eu_top - name: Light - Top + name: Light - Top EU <<: *light_partition_with_effects_disabled segments: - id: light_full @@ -152,7 +152,7 @@ light: to: 26 reversed: false - id: light_us_bottom - name: Light - Bottom + name: Light - Bottom US <<: *light_partition_with_effects_disabled segments: - id: light_full @@ -160,7 +160,7 @@ light: to: 14 reversed: true - id: light_us_left - name: Light - Left + name: Light - Left US <<: *light_partition_with_effects_disabled segments: - id: light_full @@ -168,7 +168,7 @@ light: to: 24 reversed: true - id: light_us_right - name: Light - Right + name: Light - Right US <<: *light_partition_with_effects_disabled segments: - id: light_full @@ -180,7 +180,7 @@ light: to: 8 reversed: false - id: light_us_top - name: Light - Top + name: Light - Top US <<: *light_partition_with_effects_disabled segments: - id: light_full @@ -567,7 +567,7 @@ select: # EU relay light mode template - &relay_light_mode_eu id: sl_relay_1_light_mode_eu - name: Relay 1 light mode + name: Relay 1 light mode EU platform: template options: - "${LIGHT_MODE_DISABLED_TEXT}" @@ -582,19 +582,19 @@ select: disabled_by_default: false icon: mdi:dots-square - id: sl_relay_2_light_mode_eu - name: Relay 2 light mode + name: Relay 2 light mode EU <<: *relay_light_mode_eu - id: sl_relay_3_light_mode_eu - name: Relay 3 light mode + name: Relay 3 light mode EU <<: *relay_light_mode_eu - id: sl_relay_4_light_mode_eu - name: Relay 4 light mode + name: Relay 4 light mode EU <<: *relay_light_mode_eu # US relay light mode template - &relay_light_mode_us id: sl_relay_1_light_mode_us - name: Relay 1 light mode + name: Relay 1 light mode US platform: template options: - "${LIGHT_MODE_DISABLED_TEXT}" @@ -609,12 +609,12 @@ select: disabled_by_default: false icon: mdi:dots-square - id: sl_relay_2_light_mode_us - name: Relay 2 light mode + name: Relay 2 light mode US <<: *relay_light_mode_us - id: sl_relay_3_light_mode_us - name: Relay 3 light mode + name: Relay 3 light mode US <<: *relay_light_mode_us - id: sl_relay_4_light_mode_us - name: Relay 4 light mode + name: Relay 4 light mode US <<: *relay_light_mode_us ... diff --git a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml index 45241a9..cf90e54 100644 --- a/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml +++ b/ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml @@ -386,69 +386,74 @@ tx_ultimate_easy: } on_multi_touch_release: - - homeassistant.event: - event: esphome.tx_ultimate_easy - data: - device_name: !lambda return tx_device_name->state.c_str(); - firmware: ${version} - domain: touch - type: multi_touch - action: release - position: !lambda return touch.x; - - lambda: ESP_LOGI("core_hw_touch", "Multi-touch released"); - - script.execute: touch_on_multi_touch_release + then: + - lambda: |- + // Send event to Home Assistant + esphome::api::CustomAPIDevice ha_event; + ha_event.fire_homeassistant_event("${EVENT_NAME}", { + {"device_name", id(tx_device_name).state.c_str()}, + {"firmware", "${version}"}, + {"domain", "touch"}, + {"type", "multi_touch"}, + {"action", "release"}, + {"position", std::to_string(touch.x)} + }); + ESP_LOGI("core_hw_touch", "Multi-touch released"); + touch_on_multi_touch_release->execute(); on_press: - - lambda: |- - const uint8_t position = static_cast(touch.x); - if (position > ${TOUCH_POSITION_MAX_VALUE}) { // Check for valid range - ESP_LOGE("core_hw_touch", "Invalid touch position: %" PRIu8, position); - } else { - ESP_LOGI("core_hw_touch", "Pressed at position %" PRIu8, position); - touch_on_press->execute(static_cast(touch.button), position); - } + then: + - lambda: |- + const uint8_t position = static_cast(touch.x); + if (position > ${TOUCH_POSITION_MAX_VALUE}) { // Check for valid range + ESP_LOGE("core_hw_touch", "Invalid touch position: %" PRIu8, position); + } else { + ESP_LOGI("core_hw_touch", "Pressed at position %" PRIu8, position); + touch_on_press->execute(static_cast(touch.button), position); + } on_release: - - lambda: ESP_LOGI("core_hw_touch", "Released"); - - script.execute: touch_on_release + then: + - lambda: ESP_LOGI("core_hw_touch", "Released"); + - script.execute: touch_on_release on_swipe_left: - - homeassistant.event: - event: esphome.tx_ultimate_easy - data: - device_name: !lambda return tx_device_name->state.c_str(); - firmware: ${version} - domain: touch - type: swipe - action: !lambda |- - return sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}" ? "left" : "down"; - swipe-direction: !lambda |- - return sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}" ? "left" : "down"; - position: !lambda return touch.x; - - lambda: |- - ESP_LOGI("core_hw_touch", "Swipe %s", sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}" - ? "left" - : "down"); - - script.execute: touch_swipe_left + then: + - lambda: |- + std::string swipe_direction = (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "left" : "down"; + // Send event to Home Assistant + esphome::api::CustomAPIDevice ha_event; + ha_event.fire_homeassistant_event("${EVENT_NAME}", { + {"device_name", id(tx_device_name).state.c_str()}, + {"firmware", "${version}"}, + {"domain", "touch"}, + {"type", "swipe"}, + {"action", swipe_direction.c_str()}, + {"swipe-direction", swipe_direction.c_str()}, + {"position", std::to_string(touch.x)} + }); + ESP_LOGI("core_hw_touch", "Multi-touch released"); + touch_on_multi_touch_release->execute(); + ESP_LOGI("core_hw_touch", "Swipe %s", swipe_direction.c_str()); + touch_swipe_left->execute(); on_swipe_right: - - homeassistant.event: - event: esphome.tx_ultimate_easy - data: - device_name: !lambda return tx_device_name->state.c_str(); - firmware: ${version} - domain: touch - type: swipe - action: !lambda |- - return sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}" ? "right" : "up"; - swipe-direction: !lambda |- - return sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}" ? "right" : "up"; - position: !lambda return touch.x; - - lambda: |- - ESP_LOGI("core_hw_touch", "Swipe %s", sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}" - ? "right" - : "up"); - - script.execute: touch_swipe_right + then: + - lambda: |- + std::string swipe_direction = (sl_tx_model_format->state == "${TX_MODEL_FORMAT_EU_TEXT}") ? "right" : "up"; + // Send event to Home Assistant + esphome::api::CustomAPIDevice ha_event; + ha_event.fire_homeassistant_event("${EVENT_NAME}", { + {"device_name", id(tx_device_name).state.c_str()}, + {"firmware", "${version}"}, + {"domain", "touch"}, + {"type", "swipe"}, + {"action", swipe_direction.c_str()}, + {"swipe-direction", swipe_direction.c_str()}, + {"position", std::to_string(touch.x)} + }); + ESP_LOGI("core_hw_touch", "Swipe %s", swipe_direction.c_str()); + touch_swipe_right->execute(); on_touch_event: - lambda: |-