Edit esp-bedside-panel.yaml
This commit is contained in:
@@ -84,12 +84,12 @@ substitutions:
|
||||
# Device Naming
|
||||
device_name: "esp-bedside-panel"
|
||||
friendly_name: "ESP Bedside Panel"
|
||||
description_comment: "Guition JC1060P470C_I_W_Y ESP32-P4 bedside control panel. Direct Quiet / Boost / Normal selection, Nano-X and aligned Climate controls. (Layout V1.1)"
|
||||
description_comment: "Guition JC1060P470C_I_W_Y ESP32-P4 bedside control panel. Climate layout with guarded LVGL startup and additional memory headroom. (Layout V1.1)"
|
||||
device_area: "Bedroom"
|
||||
|
||||
# Project Naming
|
||||
project_name: "Guition.JC1060P470C_I_W_Y"
|
||||
project_version: "v0.8q"
|
||||
project_version: "v0.8r"
|
||||
|
||||
# Passwords & Secrets
|
||||
api_key: !secret esp-api_key
|
||||
@@ -205,6 +205,18 @@ esphome:
|
||||
name: "${project_name}"
|
||||
version: "${project_version}"
|
||||
|
||||
# Do not update LVGL widgets until page construction has completed.
|
||||
on_boot:
|
||||
priority: -100
|
||||
then:
|
||||
- delay: 2s
|
||||
|
||||
- lambda: |-
|
||||
id(lvgl_ready) = true;
|
||||
|
||||
- script.execute: refresh_api_indicator
|
||||
- script.execute: refresh_button_states
|
||||
|
||||
#:########################################################################################:#
|
||||
# ESP PLATFORM AND FRAMEWORK:
|
||||
# https://esphome.io/components/esp32.html
|
||||
@@ -278,9 +290,7 @@ api:
|
||||
level: INFO
|
||||
format: "API connected: ESP Bedside Panel is online"
|
||||
|
||||
- lvgl.widget.update:
|
||||
id: bedroom_connection_indicator
|
||||
bg_color: 0x65D483
|
||||
- script.execute: refresh_api_indicator
|
||||
|
||||
# HA may deliver imported entity states before all LVGL widgets are ready.
|
||||
# Run a delayed two-pass refresh so startup colours always match HA.
|
||||
@@ -295,18 +305,7 @@ api:
|
||||
# Allow another API client to remain connected before showing offline.
|
||||
- delay: 500ms
|
||||
|
||||
- if:
|
||||
condition:
|
||||
api.connected:
|
||||
then:
|
||||
- lvgl.widget.update:
|
||||
id: bedroom_connection_indicator
|
||||
bg_color: 0x65D483
|
||||
|
||||
else:
|
||||
- lvgl.widget.update:
|
||||
id: bedroom_connection_indicator
|
||||
bg_color: 0xF06A6A
|
||||
- script.execute: refresh_api_indicator
|
||||
|
||||
#:########################################################################################:#
|
||||
# OTA:
|
||||
@@ -748,6 +747,12 @@ binary_sensor:
|
||||
# Local optimistic Heat Pump profile state
|
||||
#:########################################################################################:#
|
||||
globals:
|
||||
# Prevent state callbacks from touching widgets while LVGL creates pages.
|
||||
- id: lvgl_ready
|
||||
type: bool
|
||||
restore_value: false
|
||||
initial_value: "false"
|
||||
|
||||
# 0 = Normal, 1 = Quiet, 2 = Boost.
|
||||
- id: climate_profile_optimistic
|
||||
type: int
|
||||
@@ -759,6 +764,30 @@ globals:
|
||||
# Refresh all state-dependent LVGL button colours
|
||||
#:########################################################################################:#
|
||||
script:
|
||||
# Update the API status indicator only after LVGL has finished constructing.
|
||||
- id: refresh_api_indicator
|
||||
mode: restart
|
||||
then:
|
||||
- if:
|
||||
condition:
|
||||
lambda: |-
|
||||
return id(lvgl_ready);
|
||||
|
||||
then:
|
||||
- if:
|
||||
condition:
|
||||
api.connected:
|
||||
|
||||
then:
|
||||
- lvgl.widget.update:
|
||||
id: bedroom_connection_indicator
|
||||
bg_color: 0x65D483
|
||||
|
||||
else:
|
||||
- lvgl.widget.update:
|
||||
id: bedroom_connection_indicator
|
||||
bg_color: 0xF06A6A
|
||||
|
||||
# Immediate refresh using the latest imported Home Assistant states.
|
||||
- id: refresh_button_states
|
||||
mode: restart
|
||||
@@ -862,6 +891,12 @@ script:
|
||||
# Update Climate-page labels and highlight the currently selected settings.
|
||||
- id: refresh_climate_controls
|
||||
mode: restart
|
||||
then:
|
||||
- if:
|
||||
condition:
|
||||
lambda: |-
|
||||
return id(lvgl_ready);
|
||||
|
||||
then:
|
||||
# Heat-pump mode buttons. The requested mode wins while a change is
|
||||
# pending; when it is "none", the actual climate state is used.
|
||||
@@ -1184,7 +1219,7 @@ lvgl:
|
||||
long_press_repeat_time: 500ms
|
||||
|
||||
rotation: 0
|
||||
buffer_size: 8%
|
||||
buffer_size: 6%
|
||||
log_level: WARN
|
||||
default_font: font_button
|
||||
page_wrap: false
|
||||
|
||||
Reference in New Issue
Block a user