[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:
Clyde Stubbs
2026-04-28 22:00:29 +10:00
committed by GitHub
parent 876c8c4c2a
commit 52f80618d4
2 changed files with 41 additions and 9 deletions

View File

@@ -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