parent
e2a1b8841b
commit
545e3e9ff1
|
|
@ -47,21 +47,17 @@ light:
|
||||||
restore_mode: RESTORE_AND_ON
|
restore_mode: RESTORE_AND_ON
|
||||||
|
|
||||||
font:
|
font:
|
||||||
- file: "gfonts://Atkinson Hyperlegible"
|
- file: "gfonts://Orbitron"
|
||||||
id: dspfont
|
id: dspfont
|
||||||
size: 100
|
size: 69
|
||||||
|
|
||||||
- file: "gfonts://Atkinson Hyperlegible"
|
- file: "gfonts://Orbitron"
|
||||||
id: dspfont_small
|
id: dspfont_small
|
||||||
size: 30
|
size: 26
|
||||||
|
|
||||||
- file: "gfonts://Atkinson Hyperlegible"
|
- file: "gfonts://Orbitron"
|
||||||
id: dspfont_medium
|
id: dspfont_medium
|
||||||
size: 50
|
size: 38
|
||||||
|
|
||||||
- file: "gfonts://Atkinson Hyperlegible"
|
|
||||||
id: dspfont_am_pm
|
|
||||||
size: 20
|
|
||||||
|
|
||||||
color:
|
color:
|
||||||
- id: color_white
|
- id: color_white
|
||||||
|
|
@ -101,20 +97,15 @@ display:
|
||||||
if (id(air_purifier_outlet1).state) {
|
if (id(air_purifier_outlet1).state) {
|
||||||
text_color = id(color_green);
|
text_color = id(color_green);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display the time in 12-hour format
|
// Display the time in 12-hour format
|
||||||
it.strftime(0, 75, id(dspfont), text_color, TextAlign::BASELINE_LEFT, "%l:%M", id(esptime).now());
|
it.strftime(0, 80, id(dspfont), text_color, TextAlign::BASELINE_LEFT, "%l:%M", id(esptime).now());
|
||||||
|
|
||||||
// Get the current month and day using a formatted string
|
// Display the date in abbreviated weekday, MM/DD format (no year)
|
||||||
char date_str[6];
|
it.strftime(0, 140, id(dspfont_medium), text_color, TextAlign::BASELINE, "%a %m/%d", id(esptime).now());
|
||||||
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"
|
// Display "Party mode: ON" or "No fun allowed"
|
||||||
if (id(air_purifier_outlet1).state) {
|
if (id(air_purifier_outlet1).state) {
|
||||||
it.printf(0, 230, id(dspfont_small), text_color, TextAlign::BASELINE_LEFT, "Party mode: ON");
|
it.printf(0, 230, id(dspfont_small), text_color, TextAlign::BASELINE_LEFT, "Party mode: ON");
|
||||||
} else {
|
} else {
|
||||||
it.printf(0, 230, id(dspfont_small), text_color, TextAlign::BASELINE_LEFT, "No fun allowed");
|
it.printf(0, 230, id(dspfont_small), text_color, TextAlign::BASELINE_LEFT, "No fun allowed");
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue