Update clock.yaml/clock.yaml
This commit is contained in:
parent
bb2aee5b0d
commit
e2a1b8841b
|
|
@ -49,7 +49,7 @@ light:
|
|||
font:
|
||||
- file: "gfonts://Atkinson Hyperlegible"
|
||||
id: dspfont
|
||||
size: 75
|
||||
size: 100
|
||||
|
||||
- file: "gfonts://Atkinson Hyperlegible"
|
||||
id: dspfont_small
|
||||
|
|
@ -57,7 +57,7 @@ font:
|
|||
|
||||
- file: "gfonts://Atkinson Hyperlegible"
|
||||
id: dspfont_medium
|
||||
size: 40
|
||||
size: 50
|
||||
|
||||
- file: "gfonts://Atkinson Hyperlegible"
|
||||
id: dspfont_am_pm
|
||||
|
|
@ -93,7 +93,7 @@ display:
|
|||
dc_pin: GPIO00
|
||||
reset_pin: GPIO02
|
||||
eightbitcolor: true
|
||||
update_interval: 5s
|
||||
update_interval: 30s
|
||||
id: disp
|
||||
spi_mode: mode3
|
||||
lambda: |-
|
||||
|
|
@ -101,15 +101,17 @@ display:
|
|||
if (id(air_purifier_outlet1).state) {
|
||||
text_color = id(color_green);
|
||||
}
|
||||
|
||||
// Display the time in 12-hour format
|
||||
it.strftime(0, 60, id(dspfont), text_color, TextAlign::BASELINE_LEFT, "%l:%M", id(esptime).now());
|
||||
|
||||
// Display AM/PM (Using %p to show AM/PM text)
|
||||
it.strftime(230, 42, id(dspfont_am_pm), text_color, TextAlign::BASELINE_RIGHT, "%p", id(esptime).now());
|
||||
|
||||
// Display the date in abbreviated weekday, MM/DD format (no year)
|
||||
it.strftime(0, 110, id(dspfont_medium), text_color, TextAlign::BASELINE, "%a %m/%d", id(esptime).now());
|
||||
|
||||
it.strftime(0, 75, id(dspfont), text_color, TextAlign::BASELINE_LEFT, "%l:%M", id(esptime).now());
|
||||
|
||||
// Get the current month and day using a formatted string
|
||||
char date_str[6];
|
||||
snprintf(date_str, sizeof(date_str), "%d/%02d", id(esptime).now().month(), id(esptime).now().day());
|
||||
|
||||
// Display the date in abbreviated weekday, m/dd or mm/dd format (no year)
|
||||
it.strftime(0, 125, id(dspfont_medium), text_color, TextAlign::BASELINE, "%a %s", id(esptime).now(), date_str);
|
||||
|
||||
// Display "Party mode: ON" or "No fun allowed"
|
||||
if (id(air_purifier_outlet1).state) {
|
||||
it.printf(0, 230, id(dspfont_small), text_color, TextAlign::BASELINE_LEFT, "Party mode: ON");
|
||||
|
|
|
|||
Loading…
Reference in New Issue