Edit esp-bedside-panel.yaml
This commit is contained in:
@@ -84,12 +84,12 @@ substitutions:
|
|||||||
# Device Naming
|
# Device Naming
|
||||||
device_name: "esp-bedside-panel"
|
device_name: "esp-bedside-panel"
|
||||||
friendly_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"
|
device_area: "Bedroom"
|
||||||
|
|
||||||
# Project Naming
|
# Project Naming
|
||||||
project_name: "Guition.JC1060P470C_I_W_Y"
|
project_name: "Guition.JC1060P470C_I_W_Y"
|
||||||
project_version: "v0.8q"
|
project_version: "v0.8r"
|
||||||
|
|
||||||
# Passwords & Secrets
|
# Passwords & Secrets
|
||||||
api_key: !secret esp-api_key
|
api_key: !secret esp-api_key
|
||||||
@@ -205,6 +205,18 @@ esphome:
|
|||||||
name: "${project_name}"
|
name: "${project_name}"
|
||||||
version: "${project_version}"
|
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:
|
# ESP PLATFORM AND FRAMEWORK:
|
||||||
# https://esphome.io/components/esp32.html
|
# https://esphome.io/components/esp32.html
|
||||||
@@ -278,9 +290,7 @@ api:
|
|||||||
level: INFO
|
level: INFO
|
||||||
format: "API connected: ESP Bedside Panel is online"
|
format: "API connected: ESP Bedside Panel is online"
|
||||||
|
|
||||||
- lvgl.widget.update:
|
- script.execute: refresh_api_indicator
|
||||||
id: bedroom_connection_indicator
|
|
||||||
bg_color: 0x65D483
|
|
||||||
|
|
||||||
# HA may deliver imported entity states before all LVGL widgets are ready.
|
# HA may deliver imported entity states before all LVGL widgets are ready.
|
||||||
# Run a delayed two-pass refresh so startup colours always match HA.
|
# 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.
|
# Allow another API client to remain connected before showing offline.
|
||||||
- delay: 500ms
|
- delay: 500ms
|
||||||
|
|
||||||
- if:
|
- script.execute: refresh_api_indicator
|
||||||
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
|
|
||||||
|
|
||||||
#:########################################################################################:#
|
#:########################################################################################:#
|
||||||
# OTA:
|
# OTA:
|
||||||
@@ -748,6 +747,12 @@ binary_sensor:
|
|||||||
# Local optimistic Heat Pump profile state
|
# Local optimistic Heat Pump profile state
|
||||||
#:########################################################################################:#
|
#:########################################################################################:#
|
||||||
globals:
|
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.
|
# 0 = Normal, 1 = Quiet, 2 = Boost.
|
||||||
- id: climate_profile_optimistic
|
- id: climate_profile_optimistic
|
||||||
type: int
|
type: int
|
||||||
@@ -759,6 +764,30 @@ globals:
|
|||||||
# Refresh all state-dependent LVGL button colours
|
# Refresh all state-dependent LVGL button colours
|
||||||
#:########################################################################################:#
|
#:########################################################################################:#
|
||||||
script:
|
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.
|
# Immediate refresh using the latest imported Home Assistant states.
|
||||||
- id: refresh_button_states
|
- id: refresh_button_states
|
||||||
mode: restart
|
mode: restart
|
||||||
@@ -862,6 +891,12 @@ script:
|
|||||||
# Update Climate-page labels and highlight the currently selected settings.
|
# Update Climate-page labels and highlight the currently selected settings.
|
||||||
- id: refresh_climate_controls
|
- id: refresh_climate_controls
|
||||||
mode: restart
|
mode: restart
|
||||||
|
then:
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
lambda: |-
|
||||||
|
return id(lvgl_ready);
|
||||||
|
|
||||||
then:
|
then:
|
||||||
# Heat-pump mode buttons. The requested mode wins while a change is
|
# Heat-pump mode buttons. The requested mode wins while a change is
|
||||||
# pending; when it is "none", the actual climate state is used.
|
# pending; when it is "none", the actual climate state is used.
|
||||||
@@ -1184,7 +1219,7 @@ lvgl:
|
|||||||
long_press_repeat_time: 500ms
|
long_press_repeat_time: 500ms
|
||||||
|
|
||||||
rotation: 0
|
rotation: 0
|
||||||
buffer_size: 8%
|
buffer_size: 6%
|
||||||
log_level: WARN
|
log_level: WARN
|
||||||
default_font: font_button
|
default_font: font_button
|
||||||
page_wrap: false
|
page_wrap: false
|
||||||
|
|||||||
Reference in New Issue
Block a user