feat: build Home screen with live temp, mode, and setpoint controls
This commit is contained in:
parent
88042cf850
commit
d051f0cab0
3 changed files with 78 additions and 1 deletions
|
|
@ -42,3 +42,14 @@ climate:
|
|||
- switch.turn_off: relay_heat2
|
||||
- switch.turn_off: relay_cool1
|
||||
- switch.turn_off: relay_cool2
|
||||
on_state:
|
||||
then:
|
||||
- lvgl.label.update:
|
||||
id: home_mode_label
|
||||
text: !lambda |-
|
||||
switch (id(main_thermostat).mode) {
|
||||
case climate::CLIMATE_MODE_HEAT: return "Mode: Heat";
|
||||
case climate::CLIMATE_MODE_COOL: return "Mode: Cool";
|
||||
case climate::CLIMATE_MODE_OFF: return "Mode: Off";
|
||||
default: return "Mode: Idle";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,66 @@ lvgl:
|
|||
- touch_gt911
|
||||
pages:
|
||||
- id: page_home
|
||||
widgets: []
|
||||
widgets:
|
||||
- obj:
|
||||
width: 100%
|
||||
height: 510px
|
||||
pad_all: 16
|
||||
border_width: 0
|
||||
outline_width: 0
|
||||
scrollable: false
|
||||
layout:
|
||||
type: flex
|
||||
flex_flow: column
|
||||
flex_align_cross: center
|
||||
flex_align_track: center
|
||||
flex_align_main: space_evenly
|
||||
widgets:
|
||||
- label:
|
||||
id: home_temp_label
|
||||
text: "-- °C"
|
||||
text_font: montserrat_48
|
||||
- label:
|
||||
id: home_mode_label
|
||||
text: "Mode: --"
|
||||
text_font: montserrat_28
|
||||
- obj:
|
||||
width: 100%
|
||||
height: size_content
|
||||
border_width: 0
|
||||
outline_width: 0
|
||||
scrollable: false
|
||||
layout:
|
||||
type: flex
|
||||
flex_flow: row
|
||||
flex_align_cross: center
|
||||
flex_align_track: center
|
||||
flex_align_main: space_evenly
|
||||
widgets:
|
||||
- button:
|
||||
width: 140px
|
||||
height: 100px
|
||||
on_click:
|
||||
climate.control:
|
||||
id: main_thermostat
|
||||
target_temperature_low: !lambda "return id(main_thermostat).target_temperature_low - 0.5f;"
|
||||
target_temperature_high: !lambda "return id(main_thermostat).target_temperature_high - 0.5f;"
|
||||
widgets:
|
||||
- label:
|
||||
text: "-"
|
||||
text_font: montserrat_40
|
||||
- button:
|
||||
width: 140px
|
||||
height: 100px
|
||||
on_click:
|
||||
climate.control:
|
||||
id: main_thermostat
|
||||
target_temperature_low: !lambda "return id(main_thermostat).target_temperature_low + 0.5f;"
|
||||
target_temperature_high: !lambda "return id(main_thermostat).target_temperature_high + 0.5f;"
|
||||
widgets:
|
||||
- label:
|
||||
text: "+"
|
||||
text_font: montserrat_40
|
||||
- id: page_sensors
|
||||
widgets: []
|
||||
- id: page_settings
|
||||
|
|
|
|||
|
|
@ -6,6 +6,13 @@ sensor:
|
|||
temperature:
|
||||
name: "Ambient Temperature"
|
||||
id: bme280_temperature
|
||||
on_value:
|
||||
then:
|
||||
- lvgl.label.update:
|
||||
id: home_temp_label
|
||||
text:
|
||||
format: "%.1f °C"
|
||||
args: ["x"]
|
||||
humidity:
|
||||
name: "Ambient Humidity"
|
||||
id: bme280_humidity
|
||||
|
|
|
|||
Loading…
Reference in a new issue