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:
parent
55db2d535c
commit
dfa8d0a505
|
@ -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
|
||||
--------
|
||||
|
||||
|
|
|
@ -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
|
||||
-----------
|
||||
|
|
Loading…
Reference in New Issue