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:
Eduard Llull 2024-05-31 13:13:15 +02:00 committed by GitHub
parent d4ad0730db
commit 0626032aca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -92,6 +92,7 @@ Event Automation
************
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
@ -100,7 +101,8 @@ This automation will be triggered when an event of the specified types is trigge
# ...
on_event:
then:
- logger.log: "Event Triggered"
- lambda: |-
ESP_LOGD("main", "Event %s triggered.", event_type.c_str());
Configuration variables: see :ref:`Automation <automation>`.