주 표시 수정
This commit is contained in:
+24
-15
@@ -19,6 +19,10 @@ ota:
|
|||||||
- platform: esphome
|
- platform: esphome
|
||||||
password: "b36a083936b983a368c61e1706fbe467"
|
password: "b36a083936b983a368c61e1706fbe467"
|
||||||
|
|
||||||
|
time:
|
||||||
|
- platform: homeassistant
|
||||||
|
id: ha_time
|
||||||
|
|
||||||
wifi:
|
wifi:
|
||||||
ssid: !secret wifi_ssid
|
ssid: !secret wifi_ssid
|
||||||
password: !secret wifi_password
|
password: !secret wifi_password
|
||||||
@@ -42,7 +46,7 @@ display:
|
|||||||
height: 320
|
height: 320
|
||||||
offset_height: 0
|
offset_height: 0
|
||||||
offset_width: 0
|
offset_width: 0
|
||||||
dc_pin: 2
|
dc_pin: 5 # GPIO2 대신 strapping 핀이 아닌 GPIO5로 변경
|
||||||
reset_pin: 1
|
reset_pin: 1
|
||||||
cs_pin: 0
|
cs_pin: 0
|
||||||
eightbitcolor: true
|
eightbitcolor: true
|
||||||
@@ -51,25 +55,30 @@ display:
|
|||||||
|
|
||||||
|
|
||||||
lambda: |-
|
lambda: |-
|
||||||
|
it.fill(Color(0, 0, 0));
|
||||||
|
|
||||||
it.fill(Color(0, 0, 0)); // 배경 검은색
|
auto time = id(ha_time).now();
|
||||||
|
static const char *weekday_names[] = {"일", "월", "화", "수", "목", "금", "토"};
|
||||||
|
bool pm = time.hour >= 12;
|
||||||
|
int hour12 = time.hour % 12;
|
||||||
|
if (hour12 == 0) {
|
||||||
|
hour12 = 12;
|
||||||
|
}
|
||||||
|
|
||||||
// 이미지 출력 (좌표 10, 10에 출력)
|
it.printf(120, 60, id(date_font), Color(255, 255, 255), TextAlign::CENTER,
|
||||||
it.image(0, 0, id(my_logo));
|
"%02d/%02d %s요일", time.month, time.day_of_month, weekday_names[time.day_of_week]);
|
||||||
|
|
||||||
// 텍스트와 함께 출력
|
it.printf(120, 180, id(time_font), Color(255, 255, 0), TextAlign::CENTER,
|
||||||
it.print(50, 250, id(my_font),Color(255, 255, 0), "박향기");
|
"%s %02d:%02d", pm ? "PM" : "AM", hour12, time.minute);
|
||||||
|
|
||||||
|
|
||||||
font:
|
font:
|
||||||
- file: "IBMPlexSansKR-Text.ttf"
|
- file: "IBMPlexSansKR-Text.ttf"
|
||||||
id: my_font
|
id: date_font
|
||||||
size: 65
|
size: 35
|
||||||
glyphs: "0123456789:-박향기"
|
glyphs: "0123456789/ APM월화수목금토요일"
|
||||||
|
|
||||||
|
- file: "IBMPlexSansKR-Text.ttf"
|
||||||
image:
|
id: time_font
|
||||||
- file: "zen.png"
|
size: 100
|
||||||
id: my_logo
|
glyphs: "0123456789: APM"
|
||||||
#resize: 50x50 # 원하는 크기로 조절
|
|
||||||
type: RGB # 컬러 디스플레이이므로 COLOR 설정esphome
|
|
||||||
|
|||||||
Reference in New Issue
Block a user