Files
esphome/tests/components/graphical_display_menu/common.yaml
T
J. Nick Koston 14d76e9e4e
CI / Create common environment (push) Has been cancelled
CI / Check pylint (push) Has been cancelled
CI / Run script/ci-custom (push) Has been cancelled
CI / Run pytest (macOS-latest, 3.11) (push) Has been cancelled
CI / Run pytest (ubuntu-latest, 3.11) (push) Has been cancelled
CI / Run pytest (ubuntu-latest, 3.14) (push) Has been cancelled
CI / Run pytest (windows-latest, 3.11) (push) Has been cancelled
CI / Determine which jobs to run (push) Has been cancelled
CI / Run integration tests (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 1/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 2/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 3/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 4/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 IDF (push) Has been cancelled
CI / Run script/clang-tidy for ESP8266 (push) Has been cancelled
CI / Run script/clang-tidy for ZEPHYR (push) Has been cancelled
CI / Split components for intelligent grouping (40 weighted per batch) (push) Has been cancelled
CI / Test components batch (${{ matrix.components }}) (push) Has been cancelled
CI / pre-commit.ci lite (push) Has been cancelled
CI / CI Status (push) Has been cancelled
CI for docker images / Build docker containers (docker, ubuntu-24.04) (push) Has been cancelled
CI for docker images / Build docker containers (docker, ubuntu-24.04-arm) (push) Has been cancelled
CI for docker images / Build docker containers (ha-addon, ubuntu-24.04) (push) Has been cancelled
CI for docker images / Build docker containers (ha-addon, ubuntu-24.04-arm) (push) Has been cancelled
Synchronise Device Classes from Home Assistant / Sync Device Classes (push) Has been cancelled
[ci] Merge components with different buses to reduce CI time (#11251)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2025-10-16 16:36:03 +13:00

116 lines
3.2 KiB
YAML

display:
- platform: ssd1306_i2c
id: ssd1306_i2c_display
model: SSD1306_128X64
reset_pin: ${reset_pin}
pages:
- id: graphical_display_menu_page1
lambda: |-
it.rectangle(0, 0, it.get_width(), it.get_height());
font:
- file: "gfonts://Roboto"
id: roboto
size: 20
number:
- platform: template
id: test_number
min_value: 0
step: 1
max_value: 10
optimistic: true
select:
- platform: template
id: test_select
options:
- one
- two
optimistic: true
switch:
- platform: template
id: test_switch
optimistic: true
graphical_display_menu:
id: test_graphical_display_menu
display: ssd1306_i2c_display
font: roboto
active: false
mode: rotary
on_enter:
then:
lambda: 'ESP_LOGI("graphical_display_menu", "root enter");'
on_leave:
then:
lambda: 'ESP_LOGI("graphical_display_menu", "root leave");'
items:
- type: back
text: "Back"
- type: label
- type: menu
text: "Submenu 1"
items:
- type: back
text: "Back"
- type: menu
text: "Submenu 21"
items:
- type: back
text: "Back"
- type: command
text: "Show Main"
on_value:
then:
- display_menu.show_main: test_graphical_display_menu
- type: select
text: "Enum Item"
immediate_edit: true
select: test_select
on_enter:
then:
lambda: 'ESP_LOGI("graphical_display_menu", "select enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());'
on_leave:
then:
lambda: 'ESP_LOGI("graphical_display_menu", "select leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());'
on_value:
then:
lambda: 'ESP_LOGI("graphical_display_menu", "select value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());'
- type: number
text: "Number"
number: test_number
on_enter:
then:
lambda: 'ESP_LOGI("graphical_display_menu", "number enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());'
on_leave:
then:
lambda: 'ESP_LOGI("graphical_display_menu", "number leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());'
on_value:
then:
lambda: 'ESP_LOGI("graphical_display_menu", "number value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());'
- type: command
text: "Hide"
on_value:
then:
- display_menu.hide: test_graphical_display_menu
- type: switch
text: "Switch"
switch: test_switch
on_text: "Bright"
off_text: "Dark"
immediate_edit: false
on_value:
then:
lambda: 'ESP_LOGI("graphical_display_menu", "switch value: %s", it->get_value_text().c_str());'
- type: custom
text: !lambda 'return "Custom";'
value_lambda: 'return "Val";'
on_next:
then:
lambda: 'ESP_LOGI("graphical_display_menu", "custom next: %s", it->get_text().c_str());'
on_prev:
then:
lambda: 'ESP_LOGI("graphical_display_menu", "custom prev: %s", it->get_text().c_str());'