mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 12:17:23 +00:00
[lvgl] Allow a binary sensor to report checked or pressed state (#16073)
Co-authored-by: J. Nick Koston <nick+github@koston.org>
This commit is contained in:
@@ -16,10 +16,19 @@ binary_sensor:
|
||||
platform: template
|
||||
- id: left_sensor
|
||||
platform: template
|
||||
- platform: lvgl
|
||||
name: Button A pressed
|
||||
widget: button_a
|
||||
state: pressed
|
||||
- platform: lvgl
|
||||
name: Button A checked
|
||||
widget: button_a
|
||||
state: checked
|
||||
- platform: lvgl
|
||||
id: button_checker
|
||||
name: LVGL button
|
||||
widget: button_button
|
||||
state: checked
|
||||
on_state:
|
||||
then:
|
||||
- lvgl.checkbox.update:
|
||||
@@ -29,6 +38,12 @@ binary_sensor:
|
||||
auto y = x; // block inlining of one line return
|
||||
return y;
|
||||
|
||||
- platform: lvgl
|
||||
id: button_presser
|
||||
name: Button pressed
|
||||
widget: button_button
|
||||
state: pressed
|
||||
|
||||
lvgl:
|
||||
id: lvgl_id
|
||||
rotation: 90
|
||||
|
||||
Reference in New Issue
Block a user