85 lines
1.8 KiB
YAML
85 lines
1.8 KiB
YAML
esphome:
|
|
name: esp32-c3-mini
|
|
friendly_name: esp32-c3-mini
|
|
|
|
esp32:
|
|
board: esp32-c3-devkitm-1
|
|
framework:
|
|
type: esp-idf
|
|
|
|
# Enable logging
|
|
logger:
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
encryption:
|
|
key: "pGG3hzp3QUGMG1gWkO6hjsAhhiCs8GyI4qOY5V12GPY="
|
|
|
|
ota:
|
|
- platform: esphome
|
|
password: "b36a083936b983a368c61e1706fbe467"
|
|
|
|
time:
|
|
- platform: homeassistant
|
|
id: ha_time
|
|
|
|
wifi:
|
|
ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
|
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
ap:
|
|
ssid: "Esp32-C3-Mini Fallback Hotspot"
|
|
password: "oHqcIfdnKI2n"
|
|
|
|
captive_portal:
|
|
|
|
|
|
spi:
|
|
clk_pin: 4 # 4 SCL 핀
|
|
mosi_pin: 3 # 6 SDA 핀 (변경)
|
|
|
|
display:
|
|
- platform: st7789v
|
|
model: Custom
|
|
width: 240
|
|
height: 320
|
|
offset_height: 0
|
|
offset_width: 0
|
|
dc_pin: 5 # GPIO2 대신 strapping 핀이 아닌 GPIO5로 변경
|
|
reset_pin: 1
|
|
cs_pin: 0
|
|
eightbitcolor: true
|
|
rotation: 90
|
|
update_interval: 10s
|
|
|
|
|
|
lambda: |-
|
|
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;
|
|
}
|
|
|
|
it.printf(120, 60, id(date_font), Color(255, 255, 255), TextAlign::CENTER,
|
|
"%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,
|
|
"%s %02d:%02d", pm ? "PM" : "AM", hour12, time.minute);
|
|
|
|
|
|
font:
|
|
- file: "IBMPlexSansKR-Text.ttf"
|
|
id: date_font
|
|
size: 35
|
|
glyphs: "0123456789/ APM월화수목금토요일"
|
|
|
|
- file: "IBMPlexSansKR-Text.ttf"
|
|
id: time_font
|
|
size: 100
|
|
glyphs: "0123456789: APM"
|