Remove dead values from HA and rendering code. Also increase font size.
This commit is contained in:
@@ -74,6 +74,10 @@ globals:
|
||||
type: int
|
||||
initial_value: "0"
|
||||
restore_value: no
|
||||
- id: atorch_connected
|
||||
type: bool
|
||||
initial_value: "false"
|
||||
restore_value: no
|
||||
|
||||
interval:
|
||||
- interval: 10s
|
||||
@@ -108,6 +112,16 @@ ble_client:
|
||||
|
||||
- mac_address: ${dl24_mac_address}
|
||||
id: atorch_ble_client
|
||||
on_connect:
|
||||
then:
|
||||
- lambda: |-
|
||||
id(atorch_connected) = true;
|
||||
id(lcd).update();
|
||||
on_disconnect:
|
||||
then:
|
||||
- lambda: |-
|
||||
id(atorch_connected) = false;
|
||||
id(lcd).update();
|
||||
|
||||
atorch_dl24:
|
||||
- id: atorch0
|
||||
@@ -217,6 +231,33 @@ font:
|
||||
"Ω",
|
||||
]
|
||||
|
||||
- file: "fonts/Roboto-Medium.ttf"
|
||||
id: atorch_value_font
|
||||
size: 22
|
||||
glyphs:
|
||||
[
|
||||
" ",
|
||||
"+",
|
||||
"-",
|
||||
".",
|
||||
"0",
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
"A",
|
||||
"C",
|
||||
"V",
|
||||
"W",
|
||||
"h",
|
||||
"°",
|
||||
]
|
||||
|
||||
display:
|
||||
- platform: mipi_spi
|
||||
id: lcd
|
||||
@@ -226,15 +267,14 @@ display:
|
||||
owon_meter.render(
|
||||
it,
|
||||
id(meter_font),
|
||||
id(atorch_value_font),
|
||||
id(display_page),
|
||||
id(atorch_running).state,
|
||||
id(atorch_connected),
|
||||
id(atorch_voltage).has_state() ? id(atorch_voltage).state : NAN,
|
||||
id(atorch_current).has_state() ? id(atorch_current).state : NAN,
|
||||
id(atorch_power).has_state() ? id(atorch_power).state : NAN,
|
||||
id(atorch_capacity).has_state() ? id(atorch_capacity).state : NAN,
|
||||
id(atorch_energy).has_state() ? id(atorch_energy).state : NAN,
|
||||
id(atorch_temperature).has_state() ? id(atorch_temperature).state : NAN,
|
||||
id(atorch_runtime_formatted).has_state() ? id(atorch_runtime_formatted).state.c_str() : "--:--:--"
|
||||
id(atorch_temperature).has_state() ? id(atorch_temperature).state : NAN
|
||||
);
|
||||
|
||||
touchscreen:
|
||||
@@ -330,6 +370,11 @@ binary_sensor:
|
||||
name: "${friendly_name} OWON Low Battery"
|
||||
lambda: |-
|
||||
return owon_meter.low_battery;
|
||||
- platform: template
|
||||
name: "${friendly_name} Atorch Connected"
|
||||
device_class: connectivity
|
||||
lambda: |-
|
||||
return id(atorch_connected);
|
||||
|
||||
sensor:
|
||||
- platform: ble_client
|
||||
|
||||
Reference in New Issue
Block a user