Add the documentation for the on_page_change display trigger (#1097)

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
This commit is contained in:
Stanislav Meduna 2021-07-19 20:08:34 +02:00 committed by GitHub
parent 55db2d535c
commit dfa8d0a505
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -573,7 +573,27 @@ You can then switch between these with three different actions:
then:
...
.. _display-on_page_change-trigger:
**on_page_change**: This automation will be triggered when the page that is shown changes.
.. code-block:: yaml
display:
- platform: ...
# ...
on_page_change:
- from: page1
to: page2
then:
lambda: |-
ESP_LOGD("display", "Page changed from 1 to 2");
- **from** (*Optional*, :ref:`config-id`): A page id. If set the automation is only triggered if changing from this page. Defaults to all pages.
- **to** (*Optional*, :ref:`config-id`): A page id. If set the automation is only triggered if changing to this page. Defaults to all pages.
Additionally the old page will be given as the variable ``from`` and the new one as the variable ``to``.
See Also
--------

View File

@ -334,6 +334,7 @@ All Triggers
- :ref:`switch.on_turn_on/off <switch-on_turn_on_off_trigger>`
- :ref:`sim800l.on_sms_received <sim800l-on_sms_received>`
- :ref:`rf_bridge.on_code_received <rf_bridge-on_code_received>`
- :ref:`display.on_page_change <display-on_page_change-trigger>`
All Actions
-----------