Create standard package
This commit is contained in:
121
.github/workflows/validate_esphome_beta.yml
vendored
121
.github/workflows/validate_esphome_beta.yml
vendored
@@ -49,36 +49,135 @@ jobs:
|
|||||||
- name: Validate YAML files
|
- name: Validate YAML files
|
||||||
run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} +
|
run: find . -name "*.yaml" -exec yamllint -c ./.rules/yamllint.yml {} +
|
||||||
|
|
||||||
build_basic:
|
build_ard_core:
|
||||||
name: Basic
|
name: Core (Arduino)
|
||||||
|
needs: code_scan
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@main
|
- 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
|
uses: esphome/build-action@main
|
||||||
with:
|
with:
|
||||||
yaml-file: ".test/esphome_ard_basic.yaml"
|
yaml-file: ".test/esphome_ard_basic.yaml"
|
||||||
version: beta
|
version: beta
|
||||||
|
|
||||||
build_bluetooth_proxy_4:
|
build_idf_basic:
|
||||||
name: Bluetooth Proxy (IDF)
|
name: Core (IDF)
|
||||||
|
needs: build_idf_core
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@main
|
- uses: actions/checkout@main
|
||||||
- name: Build core
|
- name: Build Basic (IDF)
|
||||||
uses: esphome/build-action@main
|
uses: esphome/build-action@main
|
||||||
with:
|
with:
|
||||||
yaml-file: ".test/esphome_idf_bluetooth_proxy.yaml"
|
yaml-file: ".test/esphome_idf_basic.yaml"
|
||||||
version: beta
|
version: beta
|
||||||
|
|
||||||
build_bluetooth_proxy_53:
|
build_idf53_basic:
|
||||||
name: Bluetooth Proxy (IDF v5.3)
|
name: Basic (IDFv5.3)
|
||||||
|
needs: build_idf53_core
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@main
|
- uses: actions/checkout@main
|
||||||
- name: Build core
|
- name: Build Basic (IDFv5.3)
|
||||||
uses: esphome/build-action@main
|
uses: esphome/build-action@main
|
||||||
with:
|
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
|
version: beta
|
||||||
...
|
...
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
packages:
|
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:
|
esp32:
|
||||||
framework:
|
framework:
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
---
|
---
|
||||||
packages:
|
packages:
|
||||||
core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.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
|
addon_bluetooth_proxy: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml
|
||||||
|
|
||||||
|
esp32:
|
||||||
|
framework:
|
||||||
|
type: arduino
|
||||||
...
|
...
|
||||||
8
.test/esphome_ard_core.yaml
Normal file
8
.test/esphome_ard_core.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
packages:
|
||||||
|
core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml
|
||||||
|
|
||||||
|
esp32:
|
||||||
|
framework:
|
||||||
|
type: arduino
|
||||||
|
...
|
||||||
11
.test/esphome_idf53_basic.yaml
Normal file
11
.test/esphome_idf53_basic.yaml
Normal file
@@ -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
|
||||||
|
...
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
packages:
|
packages:
|
||||||
core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.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
|
addon_bluetooth_proxy: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_addon_ble_proxy.yaml
|
||||||
|
|
||||||
esp32:
|
esp32:
|
||||||
10
.test/esphome_idf53_core.yaml
Normal file
10
.test/esphome_idf53_core.yaml
Normal file
@@ -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
|
||||||
|
...
|
||||||
12
.test/esphome_idf53_media_player.yaml
Normal file
12
.test/esphome_idf53_media_player.yaml
Normal file
@@ -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
|
||||||
|
...
|
||||||
9
.test/esphome_idf_basic.yaml
Normal file
9
.test/esphome_idf_basic.yaml
Normal file
@@ -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
|
||||||
|
...
|
||||||
10
.test/esphome_idf_ble_proxy.yaml
Normal file
10
.test/esphome_idf_ble_proxy.yaml
Normal file
@@ -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
|
||||||
|
...
|
||||||
8
.test/esphome_idf_core.yaml
Normal file
8
.test/esphome_idf_core.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
packages:
|
||||||
|
core_package: !include ../ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml
|
||||||
|
|
||||||
|
esp32:
|
||||||
|
framework:
|
||||||
|
type: esp-idf
|
||||||
|
...
|
||||||
10
.test/esphome_idf_media_player.yaml
Normal file
10
.test/esphome_idf_media_player.yaml
Normal file
@@ -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
|
||||||
|
...
|
||||||
@@ -19,8 +19,9 @@ esphome:
|
|||||||
- -D TX_ULTIMATE_EASY_ADDON_BLE_PROXY
|
- -D TX_ULTIMATE_EASY_ADDON_BLE_PROXY
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- id: !extend dump_config
|
- id: !extend dump_config_list_packages
|
||||||
then:
|
then:
|
||||||
|
- script.wait: dump_config
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
// Check for requirements
|
// Check for requirements
|
||||||
#if !defined(TX_ULTIMATE_EASY_CORE)
|
#if !defined(TX_ULTIMATE_EASY_CORE)
|
||||||
@@ -28,5 +29,5 @@ script:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Identify itself
|
// Identify itself
|
||||||
ESP_LOGCONFIG("addon_ble_proxy", "Add-on BLE Proxy installed");
|
ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Add-on - BLE Proxy");
|
||||||
...
|
...
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
####################################################################################################
|
####################################################################################################
|
||||||
---
|
---
|
||||||
packages:
|
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:
|
esp32:
|
||||||
framework:
|
framework:
|
||||||
@@ -39,19 +39,20 @@ media_player:
|
|||||||
allow_other_uses: true
|
allow_other_uses: true
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- id: !extend dump_config
|
- id: !extend dump_config_list_packages
|
||||||
then:
|
then:
|
||||||
|
- script.wait: dump_config
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
// Check for requirements
|
// Check for requirements
|
||||||
#if !defined(TX_ULTIMATE_EASY_CORE)
|
#if !defined(TX_ULTIMATE_EASY_CORE)
|
||||||
#error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required."
|
#error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required."
|
||||||
#endif
|
#endif
|
||||||
#if !defined(TX_ULTIMATE_EASY_CORE_HW_AUDIO)
|
#if !defined(TX_ULTIMATE_EASY_STANDARD_HW_AUDIO)
|
||||||
#error "The package TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml is required."
|
#error "The package TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml is required."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Identify itself
|
// Identify itself
|
||||||
ESP_LOGCONFIG("addon_media_player", "Add-on Media Player installed");
|
ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Add-on - Media Player");
|
||||||
|
|
||||||
switch:
|
switch:
|
||||||
- id: sw_speaker_amplifier
|
- id: sw_speaker_amplifier
|
||||||
|
|||||||
@@ -29,11 +29,9 @@ substitutions:
|
|||||||
|
|
||||||
packages:
|
packages:
|
||||||
# yamllint disable rule:colons
|
# yamllint disable rule:colons
|
||||||
core_hw_buttons: !include TX-Ultimate-Easy-ESPHome_core_hw_buttons.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_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_touch: !include TX-Ultimate-Easy-ESPHome_core_hw_touch.yaml
|
|
||||||
core_hw_vibration: !include TX-Ultimate-Easy-ESPHome_core_hw_vibration.yaml
|
|
||||||
# yamllint enable rule:colons
|
# yamllint enable rule:colons
|
||||||
|
|
||||||
api:
|
api:
|
||||||
@@ -60,15 +58,6 @@ binary_sensor:
|
|||||||
ESP_LOGCONFIG("core", "Pending restart: No");
|
ESP_LOGCONFIG("core", "Pending restart: No");
|
||||||
- script.execute: dump_config_caller
|
- script.execute: dump_config_caller
|
||||||
|
|
||||||
button:
|
|
||||||
- id: bt_restart
|
|
||||||
name: Restart
|
|
||||||
internal: false
|
|
||||||
platform: restart
|
|
||||||
|
|
||||||
captive_portal:
|
|
||||||
id: ap_captive_portal
|
|
||||||
|
|
||||||
esp32:
|
esp32:
|
||||||
board: esp32dev # adafruit_feather_esp32_v2 # esp32dev
|
board: esp32dev # adafruit_feather_esp32_v2 # esp32dev
|
||||||
flash_size: 8MB
|
flash_size: 8MB
|
||||||
@@ -79,6 +68,9 @@ esphome:
|
|||||||
name: ${name}
|
name: ${name}
|
||||||
friendly_name: ${friendly_name}
|
friendly_name: ${friendly_name}
|
||||||
comment: TX Ultimate Easy
|
comment: TX Ultimate Easy
|
||||||
|
project:
|
||||||
|
name: "edwardtfn.tx_ultimate_easy"
|
||||||
|
version: ${version}
|
||||||
platformio_options:
|
platformio_options:
|
||||||
build_flags:
|
build_flags:
|
||||||
- -D TX_ULTIMATE_EASY_CORE
|
- -D TX_ULTIMATE_EASY_CORE
|
||||||
@@ -113,9 +105,6 @@ globals:
|
|||||||
max_restore_data_length: 3
|
max_restore_data_length: 3
|
||||||
# initial_value: "''"
|
# initial_value: "''"
|
||||||
|
|
||||||
improv_serial:
|
|
||||||
id: serial_improv
|
|
||||||
|
|
||||||
logger:
|
logger:
|
||||||
level: DEBUG
|
level: DEBUG
|
||||||
|
|
||||||
@@ -188,9 +177,7 @@ script:
|
|||||||
ESP_LOGCONFIG("core", "Device name (HA): %s", tx_device_name->state.c_str());
|
ESP_LOGCONFIG("core", "Device name (HA): %s", tx_device_name->state.c_str());
|
||||||
ESP_LOGCONFIG("core", "Device hostname: %s", App.get_name().c_str());
|
ESP_LOGCONFIG("core", "Device hostname: %s", App.get_name().c_str());
|
||||||
|
|
||||||
// Version information
|
dump_config_versions->execute();
|
||||||
ESP_LOGCONFIG("core", "ESPHome builder: %s", esphome_fw_version->state.c_str());
|
|
||||||
ESP_LOGCONFIG("core", "TX Ultimate firmware version: ${version}");
|
|
||||||
|
|
||||||
// Framework detection
|
// Framework detection
|
||||||
#ifdef USE_ARDUINO
|
#ifdef USE_ARDUINO
|
||||||
@@ -218,6 +205,25 @@ script:
|
|||||||
then:
|
then:
|
||||||
- delay: ${DUMP_CONFIG_CALLER_DELAY}
|
- delay: ${DUMP_CONFIG_CALLER_DELAY}
|
||||||
- script.execute: dump_config
|
- 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
|
- id: publish_device_info
|
||||||
mode: restart
|
mode: restart
|
||||||
@@ -275,12 +281,6 @@ select:
|
|||||||
tx_ultimate->set_gang_count(id(gang_count));
|
tx_ultimate->set_gang_count(id(gang_count));
|
||||||
|
|
||||||
text_sensor:
|
text_sensor:
|
||||||
- id: esphome_fw_version
|
|
||||||
name: ESPHome Version
|
|
||||||
platform: version
|
|
||||||
entity_category: diagnostic
|
|
||||||
internal: false
|
|
||||||
|
|
||||||
- id: tx_fw_version
|
- id: tx_fw_version
|
||||||
name: TX Ultimate Easy Firmware Version
|
name: TX Ultimate Easy Firmware Version
|
||||||
platform: template
|
platform: template
|
||||||
@@ -317,13 +317,6 @@ text_sensor:
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
time:
|
|
||||||
- id: time_source
|
|
||||||
platform: homeassistant
|
|
||||||
|
|
||||||
web_server:
|
|
||||||
|
|
||||||
wifi:
|
wifi:
|
||||||
id: wifi_component
|
id: wifi_component
|
||||||
ap:
|
|
||||||
...
|
...
|
||||||
|
|||||||
@@ -208,11 +208,6 @@ script:
|
|||||||
- id: !extend dump_config
|
- id: !extend dump_config
|
||||||
then:
|
then:
|
||||||
- lambda: |-
|
- 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
|
// Button's actions
|
||||||
ESP_LOGCONFIG("core_hw_buttons", "Button%s action%s:",
|
ESP_LOGCONFIG("core_hw_buttons", "Button%s action%s:",
|
||||||
id(gang_count_plural_suffix).c_str(),
|
id(gang_count_plural_suffix).c_str(),
|
||||||
@@ -233,6 +228,18 @@ script:
|
|||||||
? sl_button_4_action->state.c_str()
|
? sl_button_4_action->state.c_str()
|
||||||
: "Unknown");
|
: "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
|
- id: !extend touch_on_multi_touch_release
|
||||||
then:
|
then:
|
||||||
- script.execute: buttons_release
|
- script.execute: buttons_release
|
||||||
|
|||||||
@@ -443,64 +443,9 @@ script:
|
|||||||
light_us_right->set_internal(!id(is_us_model));
|
light_us_right->set_internal(!id(is_us_model));
|
||||||
light_us_top->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
|
- id: !extend dump_config
|
||||||
then:
|
then:
|
||||||
- lambda: |-
|
- 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
|
// Relay's LEDs modes
|
||||||
ESP_LOGCONFIG("core_hw_leds", "Relay%s LEDs mode%s:",
|
ESP_LOGCONFIG("core_hw_leds", "Relay%s LEDs mode%s:",
|
||||||
id(gang_count_plural_suffix).c_str(),
|
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", " Sides: ${LIGHT_SIDES_RESTORE_MODE}");
|
||||||
ESP_LOGCONFIG("core_hw_leds", " Individual: ${LIGHT_INDIVIDUAL_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
|
- id: light_set_state
|
||||||
mode: parallel
|
mode: parallel
|
||||||
parameters:
|
parameters:
|
||||||
|
|||||||
@@ -291,11 +291,6 @@ script:
|
|||||||
- id: !extend dump_config
|
- id: !extend dump_config
|
||||||
then:
|
then:
|
||||||
- lambda: |-
|
- 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
|
// Touch panel's state
|
||||||
if (sw_touch_panel_power->state)
|
if (sw_touch_panel_power->state)
|
||||||
ESP_LOGCONFIG("core_hw_touch", "Touch panel - Power: On");
|
ESP_LOGCONFIG("core_hw_touch", "Touch panel - Power: On");
|
||||||
@@ -303,6 +298,18 @@ script:
|
|||||||
ESP_LOGW("core_hw_touch", "Touch panel - Power: OFF");
|
ESP_LOGW("core_hw_touch", "Touch panel - Power: OFF");
|
||||||
ESP_LOGCONFIG("core_hw_touch", "Touch event duration: %.0fms", nr_touch_duration->state);
|
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
|
- id: touch_on_multi_touch_release
|
||||||
mode: restart
|
mode: restart
|
||||||
then:
|
then:
|
||||||
|
|||||||
72
ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml
Normal file
72
ESPHome/TX-Ultimate-Easy-ESPHome_standard.yaml
Normal file
@@ -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:
|
||||||
|
...
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
##### TX Ultimate Easy for ESPHome #####
|
##### TX Ultimate Easy for ESPHome #####
|
||||||
##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy #####
|
##### 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 #####
|
##### Author: edwardtfn - https://github.com/edwardtfn - https://buymeacoffee.com/edwardfirmo #####
|
||||||
####################################################################################################
|
####################################################################################################
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
esphome:
|
esphome:
|
||||||
platformio_options:
|
platformio_options:
|
||||||
build_flags:
|
build_flags:
|
||||||
- -D TX_ULTIMATE_EASY_CORE_HW_AUDIO
|
- -D TX_ULTIMATE_EASY_STANDARD_HW_AUDIO
|
||||||
|
|
||||||
i2s_audio:
|
i2s_audio:
|
||||||
id: if_i2s_audio
|
id: if_i2s_audio
|
||||||
@@ -22,11 +22,15 @@ i2s_audio:
|
|||||||
i2s_lrclk_pin: GPIO4
|
i2s_lrclk_pin: GPIO4
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- id: !extend dump_config
|
- id: !extend dump_config_list_packages
|
||||||
then:
|
then:
|
||||||
|
- script.wait: dump_config
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
// Check for requirements
|
// Check for requirements
|
||||||
#if !defined(TX_ULTIMATE_EASY_CORE)
|
#if !defined(TX_ULTIMATE_EASY_CORE)
|
||||||
#error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required."
|
#error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Identify itself
|
||||||
|
ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Standard - Hardware - Audio");
|
||||||
...
|
...
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
##### TX Ultimate Easy for ESPHome #####
|
##### TX Ultimate Easy for ESPHome #####
|
||||||
##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy #####
|
##### 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 #####
|
##### Author: edwardtfn - https://github.com/edwardtfn - https://buymeacoffee.com/edwardfirmo #####
|
||||||
####################################################################################################
|
####################################################################################################
|
||||||
@@ -22,13 +22,17 @@ substitutions:
|
|||||||
esphome:
|
esphome:
|
||||||
platformio_options:
|
platformio_options:
|
||||||
build_flags:
|
build_flags:
|
||||||
- -D TX_ULTIMATE_EASY_CORE_HW_RELAYS
|
- -D TX_ULTIMATE_EASY_STANDARD_HW_RELAYS
|
||||||
|
|
||||||
globals:
|
globals:
|
||||||
- id: boot_initialization_relays
|
- id: boot_initialization_relays
|
||||||
type: bool
|
type: bool
|
||||||
restore_value: false
|
restore_value: false
|
||||||
initial_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
|
- id: boot_initialization_relays_light_modes
|
||||||
type: bool
|
type: bool
|
||||||
restore_value: false
|
restore_value: false
|
||||||
@@ -440,14 +444,17 @@ script:
|
|||||||
- id: boot_initialize_relays
|
- id: boot_initialize_relays
|
||||||
mode: restart
|
mode: restart
|
||||||
then:
|
then:
|
||||||
|
- script.execute: boot_initialize_relays_group_assignments
|
||||||
- script.execute: boot_initialize_relays_light_modes
|
- script.execute: boot_initialize_relays_light_modes
|
||||||
- script.execute: boot_initialize_relays_relay_leds
|
- script.execute: boot_initialize_relays_relay_leds
|
||||||
- script.execute: boot_initialize_relays_relay_modes
|
- 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_light_modes
|
||||||
- script.wait: boot_initialize_relays_relay_leds
|
- script.wait: boot_initialize_relays_relay_leds
|
||||||
- script.wait: boot_initialize_relays_relay_modes
|
- script.wait: boot_initialize_relays_relay_modes
|
||||||
- wait_until:
|
- wait_until:
|
||||||
condition:
|
condition:
|
||||||
|
- lambda: return id(boot_initialization_relays_group_assignments);
|
||||||
- lambda: return id(boot_initialization_relays_light_modes);
|
- lambda: return id(boot_initialization_relays_light_modes);
|
||||||
- lambda: return id(boot_initialization_relays_relay_leds);
|
- lambda: return id(boot_initialization_relays_relay_leds);
|
||||||
- lambda: return id(boot_initialization_relays_relay_modes);
|
- lambda: return id(boot_initialization_relays_relay_modes);
|
||||||
@@ -455,6 +462,61 @@ script:
|
|||||||
id: boot_initialization_relays
|
id: boot_initialization_relays
|
||||||
value: 'true'
|
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
|
- id: boot_initialize_relays_light_modes
|
||||||
mode: restart
|
mode: restart
|
||||||
then:
|
then:
|
||||||
@@ -591,13 +653,13 @@ script:
|
|||||||
std::string select_state;
|
std::string select_state;
|
||||||
bool toggle_relay = false;
|
bool toggle_relay = false;
|
||||||
if (api_disconnected) {
|
if (api_disconnected) {
|
||||||
ESP_LOGW("core_hw_relays", "Toggle relays:");
|
ESP_LOGW("standard_hw_relays", "Toggle relays:");
|
||||||
ESP_LOGW("core_hw_relays", " API state: DISCONNECTED");
|
ESP_LOGW("standard_hw_relays", " API state: DISCONNECTED");
|
||||||
ESP_LOGW("core_hw_relays", " Button: %" PRIu8, button);
|
ESP_LOGW("standard_hw_relays", " Button: %" PRIu8, button);
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGVV("core_hw_relays", "Toggle relays:");
|
ESP_LOGVV("standard_hw_relays", "Toggle relays:");
|
||||||
ESP_LOGVV("core_hw_relays", " API state: Connected");
|
ESP_LOGVV("standard_hw_relays", " API state: Connected");
|
||||||
ESP_LOGVV("core_hw_relays", " Button: %" PRIu8, button);
|
ESP_LOGVV("standard_hw_relays", " Button: %" PRIu8, button);
|
||||||
}
|
}
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case ${BUTTON_1_ID}:
|
case ${BUTTON_1_ID}:
|
||||||
@@ -630,67 +692,76 @@ script:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (toggle_relay) {
|
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()) {
|
} 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());
|
button, select_state.c_str());
|
||||||
} else {
|
} 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
|
- id: !extend dump_config
|
||||||
then:
|
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: |-
|
- lambda: |-
|
||||||
// Check for requirements
|
// Check for requirements
|
||||||
#if !defined(TX_ULTIMATE_EASY_CORE)
|
#if !defined(TX_ULTIMATE_EASY_CORE)
|
||||||
#error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required."
|
#error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Relay's modes
|
// Identify itself
|
||||||
ESP_LOGCONFIG("core_hw_relays", "Relay%s mode%s:",
|
ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Standard - Hardware - Relays");
|
||||||
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}");
|
|
||||||
|
|
||||||
- id: show_relay_status
|
- id: show_relay_status
|
||||||
mode: restart
|
mode: restart
|
||||||
@@ -698,7 +769,7 @@ script:
|
|||||||
- script.wait: boot_initialize_relays
|
- script.wait: boot_initialize_relays
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
if (not id(boot_initialization_relays)) {
|
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())
|
if (not boot_initialize_relays->is_running())
|
||||||
boot_initialize_relays->execute();
|
boot_initialize_relays->execute();
|
||||||
return;
|
return;
|
||||||
@@ -741,8 +812,8 @@ script:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGV("core_hw_relays", "Relay %" PRIu8 " is %s", i + 1, relay_state ? "ON" : "OFF");
|
ESP_LOGV("standard_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", "Light Mode for Relay %" PRIu8 ": %s", i + 1, light_mode.c_str());
|
||||||
|
|
||||||
// Use light_set_state for light updates
|
// Use light_set_state for light updates
|
||||||
if (relay_state) {
|
if (relay_state) {
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
##### TX Ultimate Easy for ESPHome #####
|
##### TX Ultimate Easy for ESPHome #####
|
||||||
##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy #####
|
##### 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 #####
|
##### Author: edwardtfn - https://github.com/edwardtfn - https://buymeacoffee.com/edwardfirmo #####
|
||||||
####################################################################################################
|
####################################################################################################
|
||||||
@@ -35,7 +35,7 @@ button:
|
|||||||
esphome:
|
esphome:
|
||||||
platformio_options:
|
platformio_options:
|
||||||
build_flags:
|
build_flags:
|
||||||
- -D TX_ULTIMATE_EASY_CORE_HW_VIBRATION
|
- -D TX_ULTIMATE_EASY_STANDARD_HW_VIBRATION
|
||||||
|
|
||||||
number:
|
number:
|
||||||
- id: nr_vibrating_duration
|
- id: nr_vibrating_duration
|
||||||
@@ -60,23 +60,30 @@ ota:
|
|||||||
script:
|
script:
|
||||||
- id: !extend dump_config
|
- id: !extend dump_config
|
||||||
then:
|
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: |-
|
- lambda: |-
|
||||||
// Check for requirements
|
// Check for requirements
|
||||||
#if !defined(TX_ULTIMATE_EASY_CORE)
|
#if !defined(TX_ULTIMATE_EASY_CORE)
|
||||||
#error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required."
|
#error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Configuration
|
// Identify itself
|
||||||
ESP_LOGCONFIG("core_hw_vibration", "Touch - Vibration feedback: %s",
|
ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Standard - Hardware - Vibration");
|
||||||
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");
|
|
||||||
|
|
||||||
- id: !extend touch_on_multi_touch_release
|
- id: !extend touch_on_multi_touch_release
|
||||||
then:
|
then:
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
##### TX Ultimate Easy for ESPHome #####
|
##### TX Ultimate Easy for ESPHome #####
|
||||||
##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy #####
|
##### 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 #####
|
##### 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
|
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:
|
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:
|
api:
|
||||||
actions:
|
actions:
|
||||||
@@ -31,14 +31,14 @@ api:
|
|||||||
- lambda: |-
|
- lambda: |-
|
||||||
rtttl_speaker->stop();
|
rtttl_speaker->stop();
|
||||||
if (speaker_volume->state > 0) {
|
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());
|
rtttl_speaker->play(tone.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
esphome:
|
esphome:
|
||||||
platformio_options:
|
platformio_options:
|
||||||
build_flags:
|
build_flags:
|
||||||
- -D TX_ULTIMATE_EASY_ADDON_SPEAKER
|
- -D TX_ULTIMATE_EASY_STANDARD_SPEAKER
|
||||||
|
|
||||||
number:
|
number:
|
||||||
- id: speaker_volume
|
- id: speaker_volume
|
||||||
@@ -74,19 +74,20 @@ rtttl:
|
|||||||
speaker: speaker_embedded
|
speaker: speaker_embedded
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- id: !extend dump_config
|
- id: !extend dump_config_list_packages
|
||||||
then:
|
then:
|
||||||
|
- script.wait: dump_config
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
// Check for requirements
|
// Check for requirements
|
||||||
#if !defined(TX_ULTIMATE_EASY_CORE)
|
#if !defined(TX_ULTIMATE_EASY_CORE)
|
||||||
#error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required."
|
#error "The package TX-Ultimate-Easy-ESPHome_core.yaml is required."
|
||||||
#endif
|
#endif
|
||||||
#if !defined(TX_ULTIMATE_EASY_CORE_HW_AUDIO)
|
#if !defined(TX_ULTIMATE_EASY_STANDARD_HW_AUDIO)
|
||||||
#error "The package TX-Ultimate-Easy-ESPHome_core_hw_audio.yaml is required."
|
#error "The package TX-Ultimate-Easy-ESPHome_standard_hw_audio.yaml is required."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Identify itself
|
// Identify itself
|
||||||
ESP_LOGCONFIG("addon_speaker", "Add-on Speaker installed");
|
ESP_LOGCONFIG(ESPHOME_PROJECT_NAME, " - Standard - Speaker");
|
||||||
|
|
||||||
- id: speaker_play_click
|
- id: speaker_play_click
|
||||||
then:
|
then:
|
||||||
@@ -19,8 +19,8 @@ packages:
|
|||||||
ref: latest # Or you can specify a version, like `ref: v2024.12.6`
|
ref: latest # Or you can specify a version, like `ref: v2024.12.6`
|
||||||
refresh: 5min
|
refresh: 5min
|
||||||
files:
|
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_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_media_player.yaml # Adds experimental Media Player (limited)
|
||||||
# - ESPHome/TX-Ultimate-Easy-ESPHome_addon_speaker.yaml # Adds basic audio speaker support
|
|
||||||
...
|
...
|
||||||
|
|||||||
Reference in New Issue
Block a user