Added "waiting for data screen"

pull/8/head
Paul-Vincent Roll 2 years ago
parent 1c96c65f51
commit 5b9024ef69

@ -24,6 +24,10 @@ globals:
type: bool type: bool
restore_value: no restore_value: no
initial_value: 'false' initial_value: 'false'
- id: initial_data_received
type: bool
restore_value: no
initial_value: 'false'
time: time:
- platform: homeassistant - platform: homeassistant
@ -35,6 +39,7 @@ time:
condition: condition:
lambda: 'return id(data_updated) == true;' lambda: 'return id(data_updated) == true;'
then: then:
- lambda: 'id(initial_data_received) = true;'
- logger.log: "Sensor data updated: Refreshing display..." - logger.log: "Sensor data updated: Refreshing display..."
- component.update: eink_display - component.update: eink_display
- lambda: 'id(data_updated) = false;' - lambda: 'id(data_updated) = false;'
@ -399,6 +404,12 @@ display:
// Fill background in black. // Fill background in black.
it.fill(color_black); it.fill(color_black);
if (id(initial_data_received) == false) {
// ATTENTION!
// Please adjust coordinates I have a different display!
// ATTENTION!
it.printf(0, 420, id(font_small_bold), color_white, TextAlign::TOP_CENTER, "Waiting for data...");
} else {
// Weather Section // Weather Section
it.image(0, 88, id(title_weather)); it.image(0, 88, id(title_weather));
@ -438,5 +449,5 @@ display:
it.printf(330, 652, id(font_medium_bold), color_white, TextAlign::TOP_CENTER, "%2.0f MIN", id(train_canarsie_next_train_due_in).state); it.printf(330, 652, id(font_medium_bold), color_white, TextAlign::TOP_CENTER, "%2.0f MIN", id(train_canarsie_next_train_due_in).state);
it.printf(150, 684, id(font_small_book), color_white, TextAlign::TOP_CENTER, "%s", id(train_manhattan_next_train_due_at).state.c_str()); it.printf(150, 684, id(font_small_book), color_white, TextAlign::TOP_CENTER, "%s", id(train_manhattan_next_train_due_at).state.c_str());
it.printf(330, 684, id(font_small_book), color_white, TextAlign::TOP_CENTER, "%s", id(train_canarsie_next_train_due_at).state.c_str()); it.printf(330, 684, id(font_small_book), color_white, TextAlign::TOP_CENTER, "%s", id(train_canarsie_next_train_due_at).state.c_str());
}
captive_portal: captive_portal:
Loading…
Cancel
Save