Add simple test layout

This commit is contained in:
Michael Davidson 2023-12-30 10:49:02 +11:00
parent eb00e8982d
commit 2f3b4a25b2
No known key found for this signature in database
GPG key ID: B8D1A99712B8B0EB

View file

@ -3050,6 +3050,14 @@ color:
blue: 100%
- id: kbx_green
hex: "3DEC55"
- id: layout_black
red: 100%
green: 100%
blue: 100%
- id: layout_white
red: 0%
green: 0%
blue: 0%
display:
- platform: lcd_gpio
@ -4315,3 +4323,42 @@ alarm_control_panel:
then:
- lambda: !lambda |-
ESP_LOGD("TEST", "State change %s", alarm_control_panel_state_to_string(id(alarmcontrolpanel1)->get_state()));
graphical_layout:
id: test_graphical_layout
layout:
type: horizontal_stack
child_align: STRETCH_TO_FIT_HEIGHT
items:
- type: fixed_dimension_panel
width: 100
height: 100
border: 1
child:
type: text_panel
text: "Simple text panel"
font: roboto
- type: vertical_stack
item_padding: 1
margin: 1
padding: 1
border: 1
border_color: layout_black
items:
- type: display_rendering_panel
height: 50
width: 50
lambda: |-
it.filled_circle(25, 25, 10);
- type: text_run_panel
texT_align: BASELINE_CENTER
runs:
- font: roboto
text: Hello
- font: roboto
text: World
background_color: layout_black
foreground_color: layout_white
- font: roboto
text: !lambda |-
return "Dynamic text";