1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 03:12:20 +01:00

[api] `homeassistant.action replaces homeassistant.service` (#7171)

This commit is contained in:
Jesse Hills
2024-08-01 22:38:36 +12:00
committed by GitHub
parent 144f1d3663
commit cb9906b921
5 changed files with 103 additions and 63 deletions

View File

@@ -5,8 +5,8 @@ esphome:
event: esphome.button_pressed
data:
message: Button was pressed
- homeassistant.service:
service: notify.html5
- homeassistant.action:
action: notify.html5
data:
message: Button was pressed
- homeassistant.tag_scanned: pulse
@@ -21,8 +21,8 @@ api:
reboot_timeout: 0min
encryption:
key: bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU=
services:
- service: hello_world
actions:
- action: hello_world
variables:
name: string
then:
@@ -30,10 +30,10 @@ api:
format: Hello World %s!
args:
- name.c_str()
- service: empty_service
- action: empty_action
then:
- logger.log: Service Called
- service: all_types
- logger.log: Action Called
- action: all_types
variables:
bool_: bool
int_: int
@@ -41,7 +41,7 @@ api:
string_: string
then:
- logger.log: Something happened
- service: array_types
- action: array_types
variables:
bool_arr: bool[]
int_arr: int[]

View File

@@ -13,12 +13,12 @@ esphome:
message: The humidity is {{ my_variable }}%.
variables:
my_variable: "return id(ha_hello_world_temperature).state;"
- homeassistant.service:
service: notify.html5
- homeassistant.action:
action: notify.html5
data:
message: Button was pressed
- homeassistant.service:
service: notify.html5
- homeassistant.action:
action: notify.html5
data:
title: New Humidity
data_template: