-
Notifications
You must be signed in to change notification settings - Fork 3
/
Korean.yaml
83 lines (81 loc) · 2.46 KB
/
Korean.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
substitutions:
# Based on the following time & date formats:
time_format12: "%l:%M%p" # 1:25PM
date_format: "%b %d" # Jan 01
date_formatA: "%a" # Mon
font:
- file: fonts/MatrixChunky8X.ttf
id: default_font
size: 8
glyphs: |
0123456789:.Sun MoTesWdhFriatAPJbpylgOcNvD오후전일월화수목금토요
# Above covers Sun Mon Tues Wed Thu Fri Sat AM PM Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec as well as Korean Dates/Times
text_sensor:
- platform: template
id: time_text
name: "$friendly_name Replacement Time Text"
entity_category: diagnostic
update_interval: never
internal: true
filters:
- lambda: |-
// Korean generally puts the 오후/오전 before the time, so let's just use a different format entirely "%p%l%M" (PM1:25) and run a substitute on it
if (id(hour12_mode) == 1) {
int offset = 0;
// delete next 3 lines if using the HA version...
if (id(tzoffset_on) != 0) {
offset = (int)(60 * 60 * (id(tzoffset)));
}
std::time_t tz1time = (id(my_time).now().timestamp + offset);
std::tm *tz1time_astm = localtime(&tz1time);
char display_tmdt[20];
strftime(display_tmdt, 20, "%p%l:%M", tz1time_astm);
std::string tmdt(display_tmdt);
return tmdt;
} else {
return x;
}
- append: ""
- prepend: ""
- substitute:
- "AM -> 오전"
- "PM -> 오후"
- platform: template
id: date_text
name: "$friendly_name Replacement Date Text"
entity_category: diagnostic
update_interval: never
internal: true
filters:
- append: "일"
- prepend: ""
- substitute:
- "Jan -> 1월"
- "Feb -> 2월"
- "Mar -> 3월"
- "Apr -> 4월"
- "May -> 5월"
- "Jun -> 6월"
- "Jul -> 7월"
- "Aug -> 8월"
- "Sep -> 9월"
- "Oct -> 10월"
- "Nov -> 11월"
- "Dec -> 12월"
- platform: template
id: dateA_text
name: "$friendly_name Replacement Date A Text"
entity_category: diagnostic
update_interval: never
internal: true
filters:
- append: ""
- prepend: ""
- substitute:
- "Sun -> 일요일"
- "Mon -> 월요일"
- "Tue -> 화요일"
- "Wed -> 수요일"
- "Thu -> 목요일"
- "Fri -> 금요일"
- "Sat -> 토요일"