feat: wire classic+ Status tab to live relay/uptime/IP data
This commit is contained in:
parent
72843b31e4
commit
bc0fe401bf
2 changed files with 78 additions and 1 deletions
77
firmware/components/status-mirror.yaml
Normal file
77
firmware/components/status-mirror.yaml
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
binary_sensor:
|
||||
- platform: template
|
||||
id: status_mirror_relay_fan
|
||||
lambda: return id(relay_fan).state;
|
||||
on_state:
|
||||
then:
|
||||
- lvgl.label.update:
|
||||
id: status_relay_fan_label
|
||||
text:
|
||||
format: "Fan: %s"
|
||||
args: ['x ? "On" : "Off"']
|
||||
- platform: template
|
||||
id: status_mirror_relay_cool1
|
||||
lambda: return id(relay_cool1).state;
|
||||
on_state:
|
||||
then:
|
||||
- lvgl.label.update:
|
||||
id: status_relay_cool1_label
|
||||
text:
|
||||
format: "Cool Stage 1: %s"
|
||||
args: ['x ? "On" : "Off"']
|
||||
- platform: template
|
||||
id: status_mirror_relay_cool2
|
||||
lambda: return id(relay_cool2).state;
|
||||
on_state:
|
||||
then:
|
||||
- lvgl.label.update:
|
||||
id: status_relay_cool2_label
|
||||
text:
|
||||
format: "Cool Stage 2: %s"
|
||||
args: ['x ? "On" : "Off"']
|
||||
- platform: template
|
||||
id: status_mirror_relay_heat1
|
||||
lambda: return id(relay_heat1).state;
|
||||
on_state:
|
||||
then:
|
||||
- lvgl.label.update:
|
||||
id: status_relay_heat1_label
|
||||
text:
|
||||
format: "Heat Stage 1: %s"
|
||||
args: ['x ? "On" : "Off"']
|
||||
- platform: template
|
||||
id: status_mirror_relay_heat2
|
||||
lambda: return id(relay_heat2).state;
|
||||
on_state:
|
||||
then:
|
||||
- lvgl.label.update:
|
||||
id: status_relay_heat2_label
|
||||
text:
|
||||
format: "Heat Stage 2: %s"
|
||||
args: ['x ? "On" : "Off"']
|
||||
|
||||
sensor:
|
||||
- platform: template
|
||||
id: status_mirror_uptime
|
||||
lambda: return id(uptime_sensor).state;
|
||||
update_interval: 60s
|
||||
on_value:
|
||||
then:
|
||||
- lvgl.label.update:
|
||||
id: status_uptime_label
|
||||
text:
|
||||
format: "Uptime: %.0f min"
|
||||
args: ["x / 60.0f"]
|
||||
|
||||
text_sensor:
|
||||
- platform: template
|
||||
id: status_mirror_ip
|
||||
lambda: return id(wifi_ip_text).state;
|
||||
update_interval: 60s
|
||||
on_value:
|
||||
then:
|
||||
- lvgl.label.update:
|
||||
id: status_ip_label
|
||||
text:
|
||||
format: "IP: %s"
|
||||
args: ["x.c_str()"]
|
||||
|
|
@ -51,4 +51,4 @@ packages:
|
|||
climate: !include components/climate.yaml
|
||||
diagnostics: !include components/diagnostics.yaml
|
||||
weather: !include components/weather.yaml
|
||||
# status_mirror: !include components/status-mirror.yaml # added in Task 3
|
||||
status_mirror: !include components/status-mirror.yaml
|
||||
|
|
|
|||
Loading…
Reference in a new issue