Display Current Time via SNTP
This commit is contained in:
@@ -41,6 +41,13 @@ wifi:
|
|||||||
|
|
||||||
captive_portal:
|
captive_portal:
|
||||||
|
|
||||||
|
time:
|
||||||
|
- platform: sntp
|
||||||
|
id: sntp_time
|
||||||
|
timezone: Europe/Berlin
|
||||||
|
servers:
|
||||||
|
- de.pool.ntp.org
|
||||||
|
|
||||||
logger:
|
logger:
|
||||||
|
|
||||||
api:
|
api:
|
||||||
@@ -100,6 +107,13 @@ display:
|
|||||||
lambda: |-
|
lambda: |-
|
||||||
it.fill(Color::BLACK);
|
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.
|
// Four bars show RSSI quality; a crossed outline means Wi-Fi is disconnected.
|
||||||
if (id(wifi_connected)) {
|
if (id(wifi_connected)) {
|
||||||
int bars = 1;
|
int bars = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user