mirror of
https://github.com/esphome/esphome.git
synced 2025-01-07 05:11:43 +01:00
Add simple test layout
This commit is contained in:
parent
eb00e8982d
commit
2f3b4a25b2
1 changed files with 47 additions and 0 deletions
|
@ -3050,6 +3050,14 @@ color:
|
||||||
blue: 100%
|
blue: 100%
|
||||||
- id: kbx_green
|
- id: kbx_green
|
||||||
hex: "3DEC55"
|
hex: "3DEC55"
|
||||||
|
- id: layout_black
|
||||||
|
red: 100%
|
||||||
|
green: 100%
|
||||||
|
blue: 100%
|
||||||
|
- id: layout_white
|
||||||
|
red: 0%
|
||||||
|
green: 0%
|
||||||
|
blue: 0%
|
||||||
|
|
||||||
display:
|
display:
|
||||||
- platform: lcd_gpio
|
- platform: lcd_gpio
|
||||||
|
@ -4315,3 +4323,42 @@ alarm_control_panel:
|
||||||
then:
|
then:
|
||||||
- lambda: !lambda |-
|
- lambda: !lambda |-
|
||||||
ESP_LOGD("TEST", "State change %s", alarm_control_panel_state_to_string(id(alarmcontrolpanel1)->get_state()));
|
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";
|
Loading…
Reference in a new issue