mirror of
https://github.com/esphome/esphome-docs.git
synced 2025-02-11 00:52:43 +01:00
Merge pull request #2459 from esphome/nagyrobi-patch-3
Update lcd_menu.rst
This commit is contained in:
commit
f14ab09819
@ -1,3 +1,5 @@
|
|||||||
|
.. _lcd_menu:
|
||||||
|
|
||||||
LCD Menu
|
LCD Menu
|
||||||
========
|
========
|
||||||
|
|
||||||
@ -6,14 +8,13 @@ LCD Menu
|
|||||||
:image: lcd_menu.png
|
:image: lcd_menu.png
|
||||||
|
|
||||||
The component provides an infrastructure for setting up a hierarchical menu
|
The component provides an infrastructure for setting up a hierarchical menu
|
||||||
on the character based LCD displays.
|
on character based LCD displays. This offers the user an interactive method to display
|
||||||
|
labels, control entities like ``switch``, ``select``, ``number`` available locally on the
|
||||||
|
ESPHome node, without the requirement of a network connection.
|
||||||
|
|
||||||
.. figure:: images/lcd_menu.png
|
.. figure:: images/lcd_menu.png
|
||||||
:align: center
|
:align: center
|
||||||
:width: 50.0%
|
:width: 60.0%
|
||||||
|
|
||||||
.. _lcd_menu:
|
|
||||||
|
|
||||||
Overview
|
Overview
|
||||||
--------
|
--------
|
||||||
@ -23,10 +24,10 @@ a hierarchical menu primarily intended to be controlled either by a rotary encod
|
|||||||
with a button or a five-button joystick controller.
|
with a button or a five-button joystick controller.
|
||||||
|
|
||||||
The component needs to be connected to an instance of a character based LCD display, which
|
The component needs to be connected to an instance of a character based LCD display, which
|
||||||
at the moment are :ref:`lcd-pcf8574` or a :ref:`lcd-gpio`. For the best results the GPIO
|
like :ref:`lcd-pcf8574` or :ref:`lcd-gpio`. For the best results the GPIO connection is
|
||||||
connection is recommended; the I²C one running at the speed according to the datasheet
|
recommended; the I²C one running at the speed according to the datasheet (usually ``100``
|
||||||
(usually ``100`` kHz) or even ESPHome default (``50`` kHz) will create perceptible delays especially
|
kHz) or even ESPHome default (``50`` kHz) will create perceptible delays especially when
|
||||||
when changing a numeric value using the rotary encoder. Most ``PCF8574`` adapters used with
|
changing a numeric value using the rotary encoder. Most ``PCF8574`` adapters used with
|
||||||
these displays will happily run at ``200`` or even ``400`` kHz though so if you are comfortable
|
these displays will happily run at ``200`` or even ``400`` kHz though so if you are comfortable
|
||||||
accepting risks from running your hardware out of spec, you might want to try that
|
accepting risks from running your hardware out of spec, you might want to try that
|
||||||
in your :ref:`i2c` configuration.
|
in your :ref:`i2c` configuration.
|
||||||
@ -41,7 +42,7 @@ in your :ref:`i2c` configuration.
|
|||||||
...
|
...
|
||||||
user_characters:
|
user_characters:
|
||||||
- position: 0
|
- position: 0
|
||||||
data: # back arrow
|
data: # mark_back symbol
|
||||||
- 0b00100
|
- 0b00100
|
||||||
- 0b01000
|
- 0b01000
|
||||||
- 0b11110
|
- 0b11110
|
||||||
@ -68,22 +69,24 @@ in your :ref:`i2c` configuration.
|
|||||||
items:
|
items:
|
||||||
...
|
...
|
||||||
|
|
||||||
# Encoder to provide navigation
|
# Rotary encoder to provide navigation
|
||||||
sensor:
|
sensor:
|
||||||
- platform: rotary_encoder
|
- platform: rotary_encoder
|
||||||
...
|
...
|
||||||
|
filters:
|
||||||
|
debounce: 30ms
|
||||||
on_anticlockwise:
|
on_anticlockwise:
|
||||||
- display_menu.up:
|
- display_menu.up:
|
||||||
on_clockwise:
|
on_clockwise:
|
||||||
- display_menu.down:
|
- display_menu.down:
|
||||||
|
|
||||||
# A de-bounced GPIO is used to 'click'
|
# A debounced GPIO push button is used to 'click'
|
||||||
binary_sensor:
|
binary_sensor:
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
...
|
...
|
||||||
filters:
|
filters:
|
||||||
- delayed_on: 10ms
|
- delayed_on: 30ms
|
||||||
- delayed_off: 10ms
|
- delayed_off: 30ms
|
||||||
on_press:
|
on_press:
|
||||||
- display_menu.enter:
|
- display_menu.enter:
|
||||||
|
|
||||||
@ -95,11 +98,11 @@ Configuration variables:
|
|||||||
Code of the character used to mark menu items going back one level, a selected one,
|
Code of the character used to mark menu items going back one level, a selected one,
|
||||||
the editing mode and item leading to a submenu. Defaults to ``0x5e`` (``^``), ``0x3e`` (``>``),
|
the editing mode and item leading to a submenu. Defaults to ``0x5e`` (``^``), ``0x3e`` (``>``),
|
||||||
``0x2a`` (``*``) and ``0x7e`` (a right arrow). As the character set lacks a good looking
|
``0x2a`` (``*``) and ``0x7e`` (a right arrow). As the character set lacks a good looking
|
||||||
up arrow, using a user defined character is advisable (use ``8`` to reference one at
|
back arrow, using a user defined character is advisable for ``mark_back`` (use ``8`` to
|
||||||
position ``0`` to avoid problems with zeros in a string).
|
reference one at position ``0`` to avoid problems with zeros in a string).
|
||||||
|
|
||||||
The rest of the configuration is described in the :ref:`Display Menu <display_menu>` component.
|
The rest of the configuration is described in the :ref:`Display Menu <display_menu>` component.
|
||||||
The menu inherits the dimensions of the connected LCD display and uses the whole area.
|
The menu inherits the dimensions of the connected LCD display and uses the entire area.
|
||||||
|
|
||||||
See Also
|
See Also
|
||||||
--------
|
--------
|
||||||
|
Loading…
Reference in New Issue
Block a user