Edit esp-bedside-panel.yaml
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
#:########################################################################################:#
|
#:########################################################################################:#
|
||||||
# VERSIONS:
|
# VERSIONS:
|
||||||
# V0.8 2026-07-14 Added large bedside clock, idle dimming and first bedroom control page
|
# V0.8 2026-07-14 Added large bedside clock, idle dimming and first bedroom control page
|
||||||
|
# Corrected YAML parsing of conditional LVGL colour lambdas
|
||||||
# V0.7 2026-07-14 Added first landscape LVGL page and Home Assistant test button
|
# V0.7 2026-07-14 Added first landscape LVGL page and Home Assistant test button
|
||||||
# V0.6 2026-07-14 Added GT911 touchscreen and touch-coordinate logging
|
# V0.6 2026-07-14 Added GT911 touchscreen and touch-coordinate logging
|
||||||
# V0.5 2026-07-14 Added corrected JC1060P470 MIPI display configuration and text test
|
# V0.5 2026-07-14 Added corrected JC1060P470 MIPI display configuration and text test
|
||||||
@@ -465,7 +466,10 @@ binary_sensor:
|
|||||||
then:
|
then:
|
||||||
- lvgl.widget.update:
|
- lvgl.widget.update:
|
||||||
id: north_lights_button
|
id: north_lights_button
|
||||||
bg_color: !lambda return x ? lv_color_hex(0xB88918) : lv_color_hex(0x28313D);
|
bg_color: !lambda |-
|
||||||
|
return x
|
||||||
|
? lv_color_hex(0xB88918)
|
||||||
|
: lv_color_hex(0x28313D);
|
||||||
|
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
id: ha_south_lights
|
id: ha_south_lights
|
||||||
@@ -476,7 +480,10 @@ binary_sensor:
|
|||||||
then:
|
then:
|
||||||
- lvgl.widget.update:
|
- lvgl.widget.update:
|
||||||
id: south_lights_button
|
id: south_lights_button
|
||||||
bg_color: !lambda return x ? lv_color_hex(0xB88918) : lv_color_hex(0x28313D);
|
bg_color: !lambda |-
|
||||||
|
return x
|
||||||
|
? lv_color_hex(0xB88918)
|
||||||
|
: lv_color_hex(0x28313D);
|
||||||
|
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
id: ha_bedside_lamp
|
id: ha_bedside_lamp
|
||||||
@@ -487,7 +494,10 @@ binary_sensor:
|
|||||||
then:
|
then:
|
||||||
- lvgl.widget.update:
|
- lvgl.widget.update:
|
||||||
id: bedside_lamp_button
|
id: bedside_lamp_button
|
||||||
bg_color: !lambda return x ? lv_color_hex(0xB88918) : lv_color_hex(0x28313D);
|
bg_color: !lambda |-
|
||||||
|
return x
|
||||||
|
? lv_color_hex(0xB88918)
|
||||||
|
: lv_color_hex(0x28313D);
|
||||||
|
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
id: ha_hall_floor
|
id: ha_hall_floor
|
||||||
@@ -498,7 +508,10 @@ binary_sensor:
|
|||||||
then:
|
then:
|
||||||
- lvgl.widget.update:
|
- lvgl.widget.update:
|
||||||
id: hall_floor_button
|
id: hall_floor_button
|
||||||
bg_color: !lambda return x ? lv_color_hex(0x92702D) : lv_color_hex(0x28313D);
|
bg_color: !lambda |-
|
||||||
|
return x
|
||||||
|
? lv_color_hex(0x92702D)
|
||||||
|
: lv_color_hex(0x28313D);
|
||||||
|
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
id: ha_hall_lights
|
id: ha_hall_lights
|
||||||
@@ -509,7 +522,10 @@ binary_sensor:
|
|||||||
then:
|
then:
|
||||||
- lvgl.widget.update:
|
- lvgl.widget.update:
|
||||||
id: hall_lights_button
|
id: hall_lights_button
|
||||||
bg_color: !lambda return x ? lv_color_hex(0xB88918) : lv_color_hex(0x28313D);
|
bg_color: !lambda |-
|
||||||
|
return x
|
||||||
|
? lv_color_hex(0xB88918)
|
||||||
|
: lv_color_hex(0x28313D);
|
||||||
|
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
id: ha_bathroom_lights
|
id: ha_bathroom_lights
|
||||||
@@ -520,7 +536,10 @@ binary_sensor:
|
|||||||
then:
|
then:
|
||||||
- lvgl.widget.update:
|
- lvgl.widget.update:
|
||||||
id: bathroom_lights_button
|
id: bathroom_lights_button
|
||||||
bg_color: !lambda return x ? lv_color_hex(0xB88918) : lv_color_hex(0x28313D);
|
bg_color: !lambda |-
|
||||||
|
return x
|
||||||
|
? lv_color_hex(0xB88918)
|
||||||
|
: lv_color_hex(0x28313D);
|
||||||
|
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
id: ha_patio_lights
|
id: ha_patio_lights
|
||||||
@@ -531,7 +550,10 @@ binary_sensor:
|
|||||||
then:
|
then:
|
||||||
- lvgl.widget.update:
|
- lvgl.widget.update:
|
||||||
id: patio_lights_button
|
id: patio_lights_button
|
||||||
bg_color: !lambda return x ? lv_color_hex(0xA87500) : lv_color_hex(0x28313D);
|
bg_color: !lambda |-
|
||||||
|
return x
|
||||||
|
? lv_color_hex(0xA87500)
|
||||||
|
: lv_color_hex(0x28313D);
|
||||||
|
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
id: ha_garage_lights
|
id: ha_garage_lights
|
||||||
@@ -546,7 +568,10 @@ binary_sensor:
|
|||||||
if (id(ha_garage_door).state) {
|
if (id(ha_garage_door).state) {
|
||||||
return lv_color_hex(0xC25B13);
|
return lv_color_hex(0xC25B13);
|
||||||
}
|
}
|
||||||
return x ? lv_color_hex(0xB88918) : lv_color_hex(0x28313D);
|
|
||||||
|
return x
|
||||||
|
? lv_color_hex(0xB88918)
|
||||||
|
: lv_color_hex(0x28313D);
|
||||||
|
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
id: ha_garage_door
|
id: ha_garage_door
|
||||||
@@ -561,6 +586,7 @@ binary_sensor:
|
|||||||
if (x) {
|
if (x) {
|
||||||
return lv_color_hex(0xC25B13);
|
return lv_color_hex(0xC25B13);
|
||||||
}
|
}
|
||||||
|
|
||||||
return id(ha_garage_lights).state
|
return id(ha_garage_lights).state
|
||||||
? lv_color_hex(0xB88918)
|
? lv_color_hex(0xB88918)
|
||||||
: lv_color_hex(0x28313D);
|
: lv_color_hex(0x28313D);
|
||||||
@@ -574,7 +600,10 @@ binary_sensor:
|
|||||||
then:
|
then:
|
||||||
- lvgl.widget.update:
|
- lvgl.widget.update:
|
||||||
id: bathroom_fan_button
|
id: bathroom_fan_button
|
||||||
bg_color: !lambda return x ? lv_color_hex(0x1668A8) : lv_color_hex(0x28313D);
|
bg_color: !lambda |-
|
||||||
|
return x
|
||||||
|
? lv_color_hex(0x1668A8)
|
||||||
|
: lv_color_hex(0x28313D);
|
||||||
|
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
id: ha_quiet_time
|
id: ha_quiet_time
|
||||||
@@ -585,12 +614,17 @@ binary_sensor:
|
|||||||
then:
|
then:
|
||||||
- lvgl.widget.update:
|
- lvgl.widget.update:
|
||||||
id: bedtime_button
|
id: bedtime_button
|
||||||
bg_color: !lambda return x ? lv_color_hex(0x705295) : lv_color_hex(0x3B3048);
|
bg_color: !lambda |-
|
||||||
|
return x
|
||||||
|
? lv_color_hex(0x705295)
|
||||||
|
: lv_color_hex(0x3B3048);
|
||||||
|
|
||||||
- lvgl.label.update:
|
- lvgl.label.update:
|
||||||
id: clock_status_label
|
id: clock_status_label
|
||||||
text: !lambda |-
|
text: !lambda |-
|
||||||
return x ? "Quiet Time active" : "";
|
return x
|
||||||
|
? std::string("Quiet Time active")
|
||||||
|
: std::string("");
|
||||||
|
|
||||||
#:########################################################################################:#
|
#:########################################################################################:#
|
||||||
# INTERVAL:
|
# INTERVAL:
|
||||||
@@ -601,27 +635,34 @@ interval:
|
|||||||
then:
|
then:
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
lambda: return id(ha_time).now().is_valid();
|
lambda: |-
|
||||||
|
return id(ha_time).now().is_valid();
|
||||||
|
|
||||||
then:
|
then:
|
||||||
- lvgl.label.update:
|
- lvgl.label.update:
|
||||||
id: clock_time_label
|
id: clock_time_label
|
||||||
text: !lambda |-
|
text: !lambda |-
|
||||||
auto now = id(ha_time).now();
|
auto now = id(ha_time).now();
|
||||||
|
|
||||||
char buffer[8];
|
char buffer[8];
|
||||||
now.strftime(buffer, sizeof(buffer), "%I:%M");
|
now.strftime(buffer, sizeof(buffer), "%I:%M");
|
||||||
|
|
||||||
std::string value(buffer);
|
std::string value(buffer);
|
||||||
|
|
||||||
if (!value.empty() && value.front() == '0') {
|
if (!value.empty() && value.front() == '0') {
|
||||||
value.erase(0, 1);
|
value.erase(0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
|
||||||
- lvgl.label.update:
|
- lvgl.label.update:
|
||||||
id: clock_ampm_label
|
id: clock_ampm_label
|
||||||
text: !lambda |-
|
text: !lambda |-
|
||||||
auto now = id(ha_time).now();
|
auto now = id(ha_time).now();
|
||||||
|
|
||||||
char buffer[4];
|
char buffer[4];
|
||||||
now.strftime(buffer, sizeof(buffer), "%p");
|
now.strftime(buffer, sizeof(buffer), "%p");
|
||||||
|
|
||||||
return std::string(buffer);
|
return std::string(buffer);
|
||||||
|
|
||||||
- lvgl.label.update:
|
- lvgl.label.update:
|
||||||
@@ -726,7 +767,6 @@ lvgl:
|
|||||||
bg_opa: COVER
|
bg_opa: COVER
|
||||||
|
|
||||||
widgets:
|
widgets:
|
||||||
# Transparent full-screen wake button.
|
|
||||||
- button:
|
- button:
|
||||||
id: clock_wake_button
|
id: clock_wake_button
|
||||||
x: 0
|
x: 0
|
||||||
@@ -858,8 +898,10 @@ lvgl:
|
|||||||
border_width: 2
|
border_width: 2
|
||||||
border_color: 0x445365
|
border_color: 0x445365
|
||||||
radius: 18
|
radius: 18
|
||||||
|
|
||||||
pressed:
|
pressed:
|
||||||
bg_color: 0x425166
|
bg_color: 0x425166
|
||||||
|
|
||||||
on_click:
|
on_click:
|
||||||
- homeassistant.action:
|
- homeassistant.action:
|
||||||
action: light.toggle
|
action: light.toggle
|
||||||
@@ -879,8 +921,10 @@ lvgl:
|
|||||||
border_width: 2
|
border_width: 2
|
||||||
border_color: 0x445365
|
border_color: 0x445365
|
||||||
radius: 18
|
radius: 18
|
||||||
|
|
||||||
pressed:
|
pressed:
|
||||||
bg_color: 0x425166
|
bg_color: 0x425166
|
||||||
|
|
||||||
on_click:
|
on_click:
|
||||||
- homeassistant.action:
|
- homeassistant.action:
|
||||||
action: switch.toggle
|
action: switch.toggle
|
||||||
@@ -900,8 +944,10 @@ lvgl:
|
|||||||
border_width: 2
|
border_width: 2
|
||||||
border_color: 0x445365
|
border_color: 0x445365
|
||||||
radius: 18
|
radius: 18
|
||||||
|
|
||||||
pressed:
|
pressed:
|
||||||
bg_color: 0x425166
|
bg_color: 0x425166
|
||||||
|
|
||||||
on_click:
|
on_click:
|
||||||
- homeassistant.action:
|
- homeassistant.action:
|
||||||
action: switch.toggle
|
action: switch.toggle
|
||||||
@@ -922,8 +968,10 @@ lvgl:
|
|||||||
border_width: 2
|
border_width: 2
|
||||||
border_color: 0x445365
|
border_color: 0x445365
|
||||||
radius: 18
|
radius: 18
|
||||||
|
|
||||||
pressed:
|
pressed:
|
||||||
bg_color: 0x425166
|
bg_color: 0x425166
|
||||||
|
|
||||||
on_click:
|
on_click:
|
||||||
- homeassistant.action:
|
- homeassistant.action:
|
||||||
action: switch.toggle
|
action: switch.toggle
|
||||||
@@ -943,8 +991,10 @@ lvgl:
|
|||||||
border_width: 2
|
border_width: 2
|
||||||
border_color: 0x445365
|
border_color: 0x445365
|
||||||
radius: 18
|
radius: 18
|
||||||
|
|
||||||
pressed:
|
pressed:
|
||||||
bg_color: 0x425166
|
bg_color: 0x425166
|
||||||
|
|
||||||
on_click:
|
on_click:
|
||||||
- homeassistant.action:
|
- homeassistant.action:
|
||||||
action: switch.toggle
|
action: switch.toggle
|
||||||
@@ -964,8 +1014,10 @@ lvgl:
|
|||||||
border_width: 2
|
border_width: 2
|
||||||
border_color: 0x445365
|
border_color: 0x445365
|
||||||
radius: 18
|
radius: 18
|
||||||
|
|
||||||
pressed:
|
pressed:
|
||||||
bg_color: 0x425166
|
bg_color: 0x425166
|
||||||
|
|
||||||
on_click:
|
on_click:
|
||||||
- homeassistant.action:
|
- homeassistant.action:
|
||||||
action: switch.toggle
|
action: switch.toggle
|
||||||
@@ -986,8 +1038,10 @@ lvgl:
|
|||||||
border_width: 2
|
border_width: 2
|
||||||
border_color: 0x445365
|
border_color: 0x445365
|
||||||
radius: 18
|
radius: 18
|
||||||
|
|
||||||
pressed:
|
pressed:
|
||||||
bg_color: 0x425166
|
bg_color: 0x425166
|
||||||
|
|
||||||
on_click:
|
on_click:
|
||||||
- homeassistant.action:
|
- homeassistant.action:
|
||||||
action: switch.toggle
|
action: switch.toggle
|
||||||
@@ -1007,8 +1061,10 @@ lvgl:
|
|||||||
border_width: 2
|
border_width: 2
|
||||||
border_color: 0x445365
|
border_color: 0x445365
|
||||||
radius: 18
|
radius: 18
|
||||||
|
|
||||||
pressed:
|
pressed:
|
||||||
bg_color: 0x425166
|
bg_color: 0x425166
|
||||||
|
|
||||||
on_click:
|
on_click:
|
||||||
- homeassistant.action:
|
- homeassistant.action:
|
||||||
action: switch.toggle
|
action: switch.toggle
|
||||||
@@ -1028,8 +1084,10 @@ lvgl:
|
|||||||
border_width: 2
|
border_width: 2
|
||||||
border_color: 0x445365
|
border_color: 0x445365
|
||||||
radius: 18
|
radius: 18
|
||||||
|
|
||||||
pressed:
|
pressed:
|
||||||
bg_color: 0x425166
|
bg_color: 0x425166
|
||||||
|
|
||||||
on_click:
|
on_click:
|
||||||
- homeassistant.action:
|
- homeassistant.action:
|
||||||
action: switch.toggle
|
action: switch.toggle
|
||||||
@@ -1050,6 +1108,7 @@ lvgl:
|
|||||||
border_width: 2
|
border_width: 2
|
||||||
border_color: 0x3E7FA7
|
border_color: 0x3E7FA7
|
||||||
radius: 16
|
radius: 16
|
||||||
|
|
||||||
on_click:
|
on_click:
|
||||||
- lvgl.page.show:
|
- lvgl.page.show:
|
||||||
id: climate_page
|
id: climate_page
|
||||||
@@ -1069,6 +1128,7 @@ lvgl:
|
|||||||
border_width: 2
|
border_width: 2
|
||||||
border_color: 0x548C6C
|
border_color: 0x548C6C
|
||||||
radius: 16
|
radius: 16
|
||||||
|
|
||||||
on_click:
|
on_click:
|
||||||
- lvgl.page.show:
|
- lvgl.page.show:
|
||||||
id: downstairs_page
|
id: downstairs_page
|
||||||
@@ -1137,6 +1197,7 @@ lvgl:
|
|||||||
text_font: font_button
|
text_font: font_button
|
||||||
bg_color: 0x28313D
|
bg_color: 0x28313D
|
||||||
radius: 18
|
radius: 18
|
||||||
|
|
||||||
on_click:
|
on_click:
|
||||||
- lvgl.page.show:
|
- lvgl.page.show:
|
||||||
id: bedroom_page
|
id: bedroom_page
|
||||||
@@ -1174,6 +1235,7 @@ lvgl:
|
|||||||
text_font: font_button
|
text_font: font_button
|
||||||
bg_color: 0x28313D
|
bg_color: 0x28313D
|
||||||
radius: 18
|
radius: 18
|
||||||
|
|
||||||
on_click:
|
on_click:
|
||||||
- lvgl.page.show:
|
- lvgl.page.show:
|
||||||
id: bedroom_page
|
id: bedroom_page
|
||||||
|
|||||||
Reference in New Issue
Block a user