lvgl sensor

This commit is contained in:
H. Árkosi Róbert 2024-05-09 10:25:35 +02:00
parent 63b591b170
commit b3d173390d
8 changed files with 60 additions and 10 deletions

View File

@ -34,6 +34,7 @@ See Also
--------
- :ref:`LVGL Main component <lvgl-main>`
- :ref:`Button widget <lvgl-wgt-btn>`
- :doc:`/components/sensor/lvgl`
- :doc:`/components/number/lvgl`
- :doc:`/components/switch/lvgl`
- :doc:`/components/select/lvgl`

View File

@ -36,13 +36,13 @@ Example:
To have linear brightness control, ``gamma_correct`` of the light is set by default to ``0``.
See Also
--------
- :ref:`LVGL Main component <lvgl-main>`
- :ref:`LED widget <lvgl-wgt-led>`
- :doc:`/components/binary_sensor/lvgl`
- :doc:`/components/switch/lvgl`
- :doc:`/components/sensor/lvgl`
- :doc:`/components/number/lvgl`
- :doc:`/components/switch/lvgl`
- :doc:`/components/select/lvgl`
- :ghedit:`Edit`

View File

@ -14,7 +14,7 @@ embedded graphics library to create beautiful UIs for any MCU, MPU and display t
In order to be able to drive a :ref:`display <display-hw>` with LVGL under ESPHome you need an MCU from the ESP32 family. Although PSRAM is not a strict requirement, it is recommended.
The display itself has to be a graphical binary type, should be configured with ``auto_clear_enabled: false`` and ``update_interval: never``, and should not have any ``lambda`` set. It should also have an :ref:`config-id` set, which will be referenced in the main LGVL component configuration.
The display itself has to be a graphical binary type, should be configured with ``auto_clear_enabled: false`` and ``update_interval: never``, and should not have any ``lambda`` set. It should have an :ref:`config-id` set, which will be referenced in the main LGVL component configuration.
For interactivity, a :ref:`Touchscreen <touchscreen-main>` (capacitive highly preferred) or a :doc:`/components/sensor/rotary_encoder` can be used.
@ -970,7 +970,7 @@ Not only the end, but also the start value of the bar can be set, which changes
id: bar_id
value: 55
The ``bar`` can be also integrated as :doc:`/components/number/lvgl`.
The ``bar`` can be also integrated as :doc:`/components/number/lvgl` or :doc:`/components/sensor/lvgl`.
.. _lvgl-wgt-sli:
@ -1038,7 +1038,7 @@ Normally, the slider can be adjusted either by dragging the knob, or by clicking
The ``on_value`` trigger is sent while the slider is being dragged or changed with keys. The event is sent *continuously* while the slider is being dragged, this can affect performance and have negative effects on the actions to be performed. In such cases use a :ref:`universal event trigger <lvgl-event-trg>` like ``on_release``, to get the ``x`` variable once after the interaction has completed.
The ``slider`` can be also integrated as :doc:`/components/number/lvgl`.
The ``slider`` can be also integrated as :doc:`/components/number/lvgl` or :doc:`/components/sensor/lvgl`.
See :ref:`lvgl-cook-bright` and :ref:`lvgl-cook-volume` for examples how to use a slider to control entities in Home Assistant.
@ -1120,7 +1120,7 @@ If the ``adv_hittest`` :ref:`flag <lvgl-objupdflag-act>` is enabled the arc can
The ``on_value`` trigger is sent while the arc knob is being dragged or changed with keys. The event is sent *continuously* while the knob is being dragged, this can affect performance and have negative effects on the actions to be performed. In such cases use a :ref:`universal event trigger <lvgl-event-trg>` like ``on_release``, to get the ``x`` variable once after the interaction has completed.
The ``arc`` can be also integrated as :doc:`/components/number/lvgl`.
The ``arc`` can be also integrated as :doc:`/components/number/lvgl` or :doc:`/components/sensor/lvgl`.
See :ref:`lvgl-cook-bright` and :ref:`lvgl-cook-volume` for examples how to use a slider (or an arc) to control entities in Home Assistant.
@ -1192,7 +1192,7 @@ The Spinbox contains a numeric value (as text) which can be increased or decreas
format: "Spinbox value is %f"
args: [ x ]
The ``spinbox`` can be also integrated as :doc:`/components/number/lvgl`.
The ``spinbox`` can be also integrated as :doc:`/components/number/lvgl` or :doc:`/components/sensor/lvgl`.
See :ref:`lvgl-cook-climate` for an example how to implement a thermostat control using the spinbox.
@ -1959,7 +1959,7 @@ See Also
- :doc:`Examples in the Cookbook </cookbook/lvgl>`
- :doc:`/components/binary_sensor/lvgl`
- :doc:`/components/switch/lvgl`
- :doc:`/components/number/lvgl`
- :doc:`/components/number/lvgl` or :doc:`/components/sensor/lvgl`
- :doc:`/components/select/lvgl`
- :doc:`/components/light/lvgl`
- :doc:`/components/display/index`

View File

@ -30,7 +30,6 @@ Example:
widget: slider_id
name: LVGL Slider
See Also
--------
- :ref:`LVGL Main component <lvgl-main>`
@ -39,6 +38,7 @@ See Also
- :ref:`Slider widget <lvgl-wgt-sli>`
- :ref:`Spinbox widget <lvgl-wgt-spb>`
- :doc:`/components/binary_sensor/lvgl`
- :doc:`/components/sensor/lvgl`
- :doc:`/components/switch/lvgl`
- :doc:`/components/select/lvgl`
- :doc:`/components/light/lvgl`

View File

@ -36,7 +36,8 @@ See Also
- :ref:`Roller widget <lvgl-wgt-rol>`
- :ref:`Dropdown widget <lvgl-wgt-drp>`
- :doc:`/components/binary_sensor/lvgl`
- :doc:`/components/switch/lvgl`
- :doc:`/components/sensor/lvgl`
- :doc:`/components/number/lvgl`
- :doc:`/components/switch/lvgl`
- :doc:`/components/light/lvgl`
- :ghedit:`Edit`

View File

@ -0,0 +1,44 @@
.. _lvgl-sns:
LVGL Sensor
===========
.. seo::
:description: Instructions for setting up a LVGL widget sensor component.
:image: ../images/lvgl_c_num.png
The ``lvgl`` sensor platform creates a semsor component from a LVGL widget
and requires :ref:`LVGL <lvgl-main>` to be configured.
Supported widgets are :ref:`lvgl-wgt-arc`, :ref:`lvgl-wgt-bar`, :ref:`lvgl-wgt-sli` and :ref:`lvgl-wgt-spb`. A single sensor supports a single widget, thus you need to choose among which one's state you want to use.
Configuration options:
----------------------
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **name** (**Required**, string): The name of the sensor.
- **widget** (**Required**): The ID of a supported widget configured in LVGL, which will reflect the state of the sensor.
- All other options from :ref:`Sensor <config-sensor>`.
Example:
.. code-block:: yaml
sensor:
- platform: lvgl
widget: slider_id
name: LVGL Slider
See Also
--------
- :ref:`LVGL Main component <lvgl-main>`
- :ref:`Arc widget <lvgl-wgt-arc>`
- :ref:`Bar widget <lvgl-wgt-bar>`
- :ref:`Slider widget <lvgl-wgt-sli>`
- :ref:`Spinbox widget <lvgl-wgt-spb>`
- :doc:`/components/binary_sensor/lvgl`
- :doc:`/components/switch/lvgl`
- :doc:`/components/select/lvgl`
- :doc:`/components/light/lvgl`
- :doc:`/components/number/lvgl`
- :ghedit:`Edit`

View File

@ -40,6 +40,7 @@ See Also
- :ref:`Switch widget <lvgl-wgt-swi>`
- :ref:`Checkbox widget <lvgl-wgt-chk>`
- :doc:`/components/binary_sensor/lvgl`
- :doc:`/components/sensor/lvgl`
- :doc:`/components/number/lvgl`
- :doc:`/components/select/lvgl`
- :doc:`/components/light/lvgl`

View File

@ -476,6 +476,7 @@ Miscellaneous
Havells Solar, components/sensor/havells_solar, havellsgti5000d_s.jpg, Solar rooftop
Integration, components/sensor/integration, sigma.svg, dark-invert
Kuntze pool sensor, components/sensor/kuntze, kuntze.jpg
LVGL widget, components/sensor/lvgl, lvgl_c_num.png
MicroNova pellet stove, components/micronova, pellet.svg
Modbus Sensor, components/sensor/modbus_controller, modbus.png
Nextion, components/sensor/nextion, nextion.jpg, Sensors from display
@ -833,6 +834,7 @@ Text Components
Text Core, components/text/index, folder-open.svg, dark-invert
Template Text, components/text/template, description.svg, dark-invert
LVGL textarea Text, components/text/lvgl, lvgl_c_txt.png
Valve Components
----------------
@ -853,6 +855,7 @@ Text Sensor Components
Ethernet Info, components/text_sensor/ethernet_info, ethernet.svg, dark-invert
Home Assistant, components/text_sensor/homeassistant, home-assistant.svg, dark-invert
LibreTiny, components/text_sensor/libretiny, libretiny.svg
LVGL textarea Text Sensor, components/text_sensor/lvgl, lvgl_c_txt.png
Modbus Text Sensor, components/text_sensor/modbus_controller, modbus.png
MQTT Subscribe Text, components/text_sensor/mqtt_subscribe, mqtt.png
Nextion Text Sensor, components/text_sensor/nextion, nextion.jpg