Update panel.yaml

This commit is contained in:
void 2025-04-08 06:28:27 +00:00
parent 480be1a2d0
commit 4270782b53
1 changed files with 120 additions and 75 deletions

View File

@ -35,7 +35,6 @@ logger:
# Enable Home Assistant API # Enable Home Assistant API
api: api:
ota: ota:
platform: esphome platform: esphome
@ -57,6 +56,14 @@ time:
then: then:
- script.execute: time_update - script.execute: time_update
bluetooth_proxy:
active: False
image:
- file: "media/grackle.png"
type: RGB
id: myimage
script: script:
- id: time_update - id: time_update
# update the clock display # update the clock display
@ -107,24 +114,27 @@ sensor:
entity_category: diagnostic entity_category: diagnostic
text_sensor: text_sensor:
- platform: wifi_info - platform: template
ip_address: name: "Virtual Switch State"
name: "IP Address" id: virtual_switch_state
id: ip_address lambda: |-
entity_category: diagnostic if (id(virtual_switch).state) {
on_value: return esphome::optional<std::string>("On");
then: } else {
- lvgl.label.update: return esphome::optional<std::string>("Off");
id: ip_address_label }
text: - platform: template
format: "%s" name: "Virtual Switch State"
args: [ 'id(ip_address).get_state().c_str()' ] id: virtual_switch_state2
ssid: lambda: |-
name: "Connected SSID" if (id(virtual_switch2).state) {
entity_category: diagnostic return esphome::optional<std::string>("On");
mac_address: } else {
name: "Mac Address" return esphome::optional<std::string>("Off");
entity_category: diagnostic }
color: color:
# Create a Home Assistant blue color # Create a Home Assistant blue color
@ -158,10 +168,6 @@ lvgl:
transition_length: 5s transition_length: 5s
- lvgl.pause: - lvgl.pause:
show_snow: true show_snow: true
#- lvgl.pause:
#- light.turn_off:
# id: display_backlight
# transition_length: 5s
style_definitions: style_definitions:
- id: style_line - id: style_line
@ -180,7 +186,6 @@ lvgl:
button: button:
text_font: roboto24 text_font: roboto24
scroll_on_focus: true scroll_on_focus: true
#group: general
radius: 25 radius: 25
width: 150 width: 150
height: 109 height: 109
@ -210,27 +215,61 @@ lvgl:
- button: - button:
height: 223 height: 223
checkable: true checkable: true
id: lv_button_1 id: lv_button_virtual2
widgets: widgets:
- label: - label:
text_font: light40 text_font: light40
align: top_left align: top_left
text: $lightbulb text: "\U000F06B5"
id: lv_button_1_icon id: lv_button_virtual_icon
- label: - label:
align: bottom_left align: bottom_left
text: "Center Light" text: "Living Room"
long_mode: dot long_mode: dot
on_click: on_click:
light.toggle: internal_light - lambda: |-
lv_state_t state = lv_obj_get_state(id(lv_button_virtual2));
if (state & LV_STATE_CHECKED) {
id(virtual_switch2).turn_on();
} else {
id(virtual_switch2).turn_off();
}
- button:
height: 223
checkable: true
id: lv_button_virtual
widgets:
- label:
text_font: light40
align: top_left
text: "\U000F06B5"
id: lv_button_virtual_icon2
- label:
align: bottom_left
text: "Kitchen"
long_mode: dot
on_click:
- lambda: |-
lv_state_t state = lv_obj_get_state(id(lv_button_virtual));
if (state & LV_STATE_CHECKED) {
id(virtual_switch).turn_on();
} else {
id(virtual_switch).turn_off();
}
- obj: - obj:
widgets: widgets:
- label: - label:
id: ip_address_label id: ip_address_label
align: CENTER align: CENTER
text: 'Not connected' text: 'Not connected'
text_color: ha_blue text_color: ha_blue
y: +10 y: +10
- meter: - meter:
height: 200 height: 200
width: 200 width: 200
@ -285,25 +324,27 @@ lvgl:
width: 4 width: 4
color: 0xA0A0A0 color: 0xA0A0A0
r_mod: -20 r_mod: -20
- obj: - obj:
widgets: widgets:
- label: - label:
styles: date_style styles: date_style
id: day_label id: day_label
y: -20 y: -20
text: !lambda |- text: !lambda |-
static const char * const day_names[] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"}; static const char * const day_names[] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
return day_names[id(time_comp).now().day_of_week-1]; return day_names[id(time_comp).now().day_of_week-1];
- label: - label:
styles: date_style styles: date_style
id: date_label id: date_label
y: +20 y: +20
text: !lambda |- text: !lambda |-
static const char * const mon_names[] = {"JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"}; static const char * const mon_names[] = {"JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"};
static char date_buf[8]; static char date_buf[8];
auto now = id(time_comp).now(); auto now = id(time_comp).now();
snprintf(date_buf, sizeof(date_buf), "%s %2d", mon_names[now.month-1], now.day_of_month); snprintf(date_buf, sizeof(date_buf), "%s %2d", mon_names[now.month-1], now.day_of_month);
return date_buf; return date_buf;
- obj: - obj:
id: popup_obj id: popup_obj
hidden: true hidden: true
@ -370,28 +411,7 @@ light:
id: backlight id: backlight
restore_mode: ALWAYS_ON restore_mode: ALWAYS_ON
- platform: binary
output: internal_relay_1
name: Internal Light
id: internal_light
on_turn_on:
then:
- lvgl.widget.update:
id: lv_button_1_icon
text_color: 0xFFFF00
- lvgl.widget.update:
id: lv_button_1
state:
checked: true
on_turn_off:
then:
- lvgl.widget.update:
id: lv_button_1_icon
text_color: 0xB6B6B6
- lvgl.widget.update:
id: lv_button_1
state:
checked: false
#------------------------------------------- #-------------------------------------------
# Graphics and Fonts # Graphics and Fonts
@ -526,3 +546,28 @@ display:
- 6 #b3 - 6 #b3
- 7 #b4 - 7 #b4
- 15 #b5 - 15 #b5
switch:
- platform: template
name: "Virtual Switch"
id: virtual_switch
internal: false # Expose to Home Assistant
optimistic: true
on_turn_on:
- lambda: |-
lv_obj_add_state(id(lv_button_virtual), LV_STATE_CHECKED);
on_turn_off:
- lambda: |-
lv_obj_clear_state(id(lv_button_virtual), LV_STATE_CHECKED);
- platform: template
name: "Virtual Switch2"
id: virtual_switch2
internal: false # Expose to Home Assistant
optimistic: true
on_turn_on:
- lambda: |-
lv_obj_add_state(id(lv_button_virtual2), LV_STATE_CHECKED);
on_turn_off:
- lambda: |-
lv_obj_clear_state(id(lv_button_virtual2), LV_STATE_CHECKED);