Update clock.yaml/clock.yaml
v3 cleanup font names, changed to doto
This commit is contained in:
parent
b365cc94fa
commit
7a094e5e41
|
|
@ -47,20 +47,20 @@ light:
|
||||||
restore_mode: RESTORE_AND_ON
|
restore_mode: RESTORE_AND_ON
|
||||||
|
|
||||||
font:
|
font:
|
||||||
- file: "gfonts://Syne Mono"
|
- file: "gfonts://Doto"
|
||||||
id: roboto
|
id: dspfont
|
||||||
size: 74
|
size: 74
|
||||||
|
|
||||||
- file: "gfonts://Syne Mono"
|
- file: "gfonts://Doto"
|
||||||
id: roboto_small
|
id: dspfont_small
|
||||||
size: 24
|
size: 24
|
||||||
|
|
||||||
- file: "gfonts://Syne Mono"
|
- file: "gfonts://Doto"
|
||||||
id: roboto_medium
|
id: dspfont_medium
|
||||||
size: 44
|
size: 44
|
||||||
|
|
||||||
- file: "gfonts://Syne Mono"
|
- file: "gfonts://Doto"
|
||||||
id: roboto_am_pm
|
id: dspfont_am_pm
|
||||||
size: 22
|
size: 22
|
||||||
|
|
||||||
color:
|
color:
|
||||||
|
|
@ -101,126 +101,18 @@ display:
|
||||||
if (id(air_purifier_outlet1).state) {
|
if (id(air_purifier_outlet1).state) {
|
||||||
text_color = id(color_green);
|
text_color = id(color_green);
|
||||||
}
|
}
|
||||||
it.strftime(0, 60, id(roboto), text_color, TextAlign::BASELINE_LEFT, "%l:%M", id(esptime).now());
|
// Display the time in 12-hour format
|
||||||
it.strftime(230, 42, id(roboto_am_pm), text_color, TextAlign::BASELINE_RIGHT, "%p", id(esptime).now());
|
it.strftime(0, 60, id(dspfont), text_color, TextAlign::BASELINE_LEFT, "%l:%M", id(esptime).now());
|
||||||
it.strftime(0, 110, id(roboto_medium), text_color, TextAlign::BASELINE, "%m/%d/%Y", 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 MM/DD/YYYY format
|
||||||
|
it.strftime(0, 110, id(dspfont_medium), text_color, TextAlign::BASELINE, "%m/%d/%Y", id(esptime).now());
|
||||||
|
|
||||||
|
// 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(roboto_small), texesphome:
|
it.printf(0, 230, id(dspfont_small), text_color, TextAlign::BASELINE_LEFT, "Party mode: ON");
|
||||||
name: mini-display-tv--yellow
|
|
||||||
friendly_name: Mini Display TV - Yellow
|
|
||||||
|
|
||||||
esp8266:
|
|
||||||
board: esp01_1m
|
|
||||||
|
|
||||||
external_components:
|
|
||||||
- source:
|
|
||||||
type: git
|
|
||||||
url: https://github.com/rletendu/esphome.git
|
|
||||||
ref: st7789_nobuffer_202312
|
|
||||||
components: [st7789v]
|
|
||||||
|
|
||||||
logger:
|
|
||||||
|
|
||||||
api:
|
|
||||||
|
|
||||||
ota:
|
|
||||||
platform: esphome
|
|
||||||
|
|
||||||
wifi:
|
|
||||||
ssid: "DNTD"
|
|
||||||
password: "wifipassword"
|
|
||||||
ap:
|
|
||||||
ssid: "Mini-Display-Tv--Yellow"
|
|
||||||
password: "wifipassword"
|
|
||||||
|
|
||||||
spi:
|
|
||||||
clk_pin: GPIO14
|
|
||||||
mosi_pin: GPIO13
|
|
||||||
interface: hardware
|
|
||||||
id: spihwd
|
|
||||||
|
|
||||||
output:
|
|
||||||
- platform: esp8266_pwm
|
|
||||||
pin: GPIO05
|
|
||||||
frequency: 1000 Hz
|
|
||||||
id: pwm_output
|
|
||||||
inverted: true
|
|
||||||
|
|
||||||
light:
|
|
||||||
- platform: monochromatic
|
|
||||||
name: "Backlight"
|
|
||||||
output: pwm_output
|
|
||||||
id: backlight
|
|
||||||
restore_mode: RESTORE_AND_ON
|
|
||||||
|
|
||||||
font:
|
|
||||||
- file: "gfonts://Syne Mono"
|
|
||||||
id: roboto
|
|
||||||
size: 74
|
|
||||||
|
|
||||||
- file: "gfonts://Syne Mono"
|
|
||||||
id: roboto_small
|
|
||||||
size: 24
|
|
||||||
|
|
||||||
- file: "gfonts://Syne Mono"
|
|
||||||
id: roboto_medium
|
|
||||||
size: 44
|
|
||||||
|
|
||||||
- file: "gfonts://Syne Mono"
|
|
||||||
id: roboto_am_pm
|
|
||||||
size: 22
|
|
||||||
|
|
||||||
color:
|
|
||||||
- id: color_white
|
|
||||||
red: 100%
|
|
||||||
green: 100%
|
|
||||||
blue: 100%
|
|
||||||
- id: color_green
|
|
||||||
red: 0%
|
|
||||||
green: 100%
|
|
||||||
blue: 0%
|
|
||||||
|
|
||||||
time:
|
|
||||||
- platform: homeassistant
|
|
||||||
id: esptime
|
|
||||||
|
|
||||||
switch:
|
|
||||||
- platform: homeassistant
|
|
||||||
id: air_purifier_outlet1
|
|
||||||
entity_id: switch.air_purifier_outlet1
|
|
||||||
|
|
||||||
display:
|
|
||||||
- platform: st7789v
|
|
||||||
model: "Custom"
|
|
||||||
spi_id: spihwd
|
|
||||||
height: 240
|
|
||||||
width: 240
|
|
||||||
offset_height: 0
|
|
||||||
offset_width: 0
|
|
||||||
dc_pin: GPIO00
|
|
||||||
reset_pin: GPIO02
|
|
||||||
eightbitcolor: true
|
|
||||||
update_interval: 5s
|
|
||||||
id: disp
|
|
||||||
spi_mode: mode3
|
|
||||||
lambda: |-
|
|
||||||
Color text_color = id(color_white);
|
|
||||||
if (id(air_purifier_outlet1).state) {
|
|
||||||
text_color = id(color_green);
|
|
||||||
}
|
|
||||||
it.strftime(0, 60, id(roboto), text_color, TextAlign::BASELINE_LEFT, "%l:%M", id(esptime).now());
|
|
||||||
it.strftime(230, 42, id(roboto_am_pm), text_color, TextAlign::BASELINE_RIGHT, "%p", id(esptime).now());
|
|
||||||
it.strftime(0, 110, id(roboto_medium), text_color, TextAlign::BASELINE, "%m/%d/%Y", id(esptime).now());
|
|
||||||
|
|
||||||
|
|
||||||
if (id(air_purifier_outlet1).state) {
|
|
||||||
it.printf(0, 230, id(roboto_small), text_color, TextAlign::BASELINE_LEFT, "Party mode: ON");
|
|
||||||
} else {
|
} else {
|
||||||
it.printf(0, 230, id(roboto_small), text_color, TextAlign::BASELINE_LEFT, "No fun allowed");
|
it.printf(0, 230, id(dspfont_small), text_color, TextAlign::BASELINE_LEFT, "No fun allowed");
|
||||||
}
|
|
||||||
t_color, TextAlign::BASELINE_LEFT, "Party mode: ON");
|
|
||||||
} else {
|
|
||||||
it.printf(0, 230, id(roboto_small), text_color, TextAlign::BASELINE_LEFT, "No fun allowed");
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue