Display Current Time via SNTP

This commit is contained in:
2026-07-29 21:20:17 +02:00
parent b7b943e4bf
commit 6a3afd71df
+14
View File
@@ -41,6 +41,13 @@ wifi:
captive_portal:
time:
- platform: sntp
id: sntp_time
timezone: Europe/Berlin
servers:
- de.pool.ntp.org
logger:
api:
@@ -100,6 +107,13 @@ display:
lambda: |-
it.fill(Color::BLACK);
if (id(sntp_time).now().is_valid()) {
it.strftime(284, 10, id(font_small), Color::WHITE, TextAlign::TOP_RIGHT,
"%H:%M", id(sntp_time).now());
} else {
it.printf(284, 10, id(font_small), Color::WHITE, TextAlign::TOP_RIGHT, "--:--");
}
// Four bars show RSSI quality; a crossed outline means Wi-Fi is disconnected.
if (id(wifi_connected)) {
int bars = 1;