mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-12-26 17:27:47 +01:00
The event type is accesible using the event_type variable. (#3891)
In the event.on_event automation, the event type that triggered the event is accesible using the event_type variable.
This commit is contained in:
parent
d4ad0730db
commit
0626032aca
@ -92,6 +92,7 @@ Event Automation
|
|||||||
************
|
************
|
||||||
|
|
||||||
This automation will be triggered when an event of the specified types is triggered.
|
This automation will be triggered when an event of the specified types is triggered.
|
||||||
|
In :ref:`Lambdas <config-lambda>` you can get the event type from the trigger with ``event_type``.
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
@ -100,7 +101,8 @@ This automation will be triggered when an event of the specified types is trigge
|
|||||||
# ...
|
# ...
|
||||||
on_event:
|
on_event:
|
||||||
then:
|
then:
|
||||||
- logger.log: "Event Triggered"
|
- lambda: |-
|
||||||
|
ESP_LOGD("main", "Event %s triggered.", event_type.c_str());
|
||||||
|
|
||||||
Configuration variables: see :ref:`Automation <automation>`.
|
Configuration variables: see :ref:`Automation <automation>`.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user