42 lines
1.9 KiB
YAML
42 lines
1.9 KiB
YAML
####################################################################################################
|
|
##### TX Ultimate Easy for ESPHome #####
|
|
##### Repository: https://github.com/edwardtfn/TX-Ultimate-Easy #####
|
|
####################################################################################################
|
|
##### Purpose: ESPHome Core - API #####
|
|
####################################################################################################
|
|
##### 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. #####
|
|
####################################################################################################
|
|
---
|
|
api:
|
|
id: api_server
|
|
on_client_connected:
|
|
then:
|
|
- script.execute: publish_device_info
|
|
|
|
script:
|
|
- id: !extend button_action
|
|
then:
|
|
- script.execute:
|
|
id: send_event_to_ha
|
|
component: !lambda return component.c_str();
|
|
event: !lambda return event.c_str();
|
|
|
|
- id: send_event_to_ha
|
|
mode: queued
|
|
parameters:
|
|
component: string
|
|
event: string
|
|
then:
|
|
- homeassistant.event:
|
|
event: esphome.tx_ultimate_easy
|
|
data:
|
|
device_name: !lambda return tx_device_name->state.c_str();
|
|
firmware: ${version}
|
|
component: !lambda return component.c_str();
|
|
event: !lambda return event.c_str();
|
|
...
|