-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
111 lines (110 loc) · 2.69 KB
/
config.py
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
from dynaconf import Validator
from pathlib import Path
VALIDATORS = [
# General
Validator("GENERAL__DEBUG", default=False, cast=bool),
Validator("GENERAL__LOG_LEVEL", default="info"), # error, warning, info, debug
Validator("GENERAL__DEMO_MODE", default=False, cast=bool),
# Web
Validator("WEB__HOST", default="0.0.0.0"),
Validator("WEB__PORT", default=5665, cast=int),
# Locale
Validator("LOCALE__DATE_FORMAT", default="%d %B %Y"),
Validator("LOCALE__TIME_FORMAT", default="%H:%M"),
# Defaults
Validator("DEFAULT__IMAGE_WIDTH", default=800, cast=int),
Validator("DEFAULT__IMAGE_HEIGHT", default=480, cast=int),
Validator("DEFAULT__OVERLAY_X", default=0, cast=int),
Validator("DEFAULT__OVERLAY_Y", default=0, cast=int),
Validator("DEFAULT__OVERLAY_SIZE", default=16, cast=int),
Validator("DEFAULT__OVERLAY_FORMAT", default="Test!", cast=str),
Validator("DEFAULT__OVERLAY_COLOR", default="white", cast=str),
# Outputs
Validator(
"OUTPUTS__0__IMAGE_PATH",
default="images/samples",
cast=Path,
),
Validator(
"OUTPUTS__0__IMAGE_SHUFFLE",
default=False,
cast=bool,
),
Validator(
"OUTPUTS__0__OVERLAY_X",
default=0,
cast=int,
),
Validator(
"OUTPUTS__0__OVERLAY_Y",
default=0,
cast=int,
),
Validator(
"OUTPUTS__0__OVERLAY_SIZE",
default=14,
cast=int,
),
Validator(
"OUTPUTS__0__OVERLAY_FORMAT",
default="{date} {time} [{current}/{total}]",
cast=str,
),
Validator(
"OUTPUTS__0__OVERLAY_COLOR",
default="white",
cast=str,
),
# MQTT
Validator(
"MQTT__HOST",
default="homeassistant.local",
cast=str,
),
Validator(
"MQTT__PORT",
default=1883,
cast=int,
),
Validator(
"MQTT__TOPIC_PREFIX__APP",
default="inkyframeweb",
cast=str,
),
Validator(
"MQTT__TOPIC_PREFIX__HOMEASSISTANT__DEFAULT",
default="homeassistant",
cast=str,
),
Validator(
"MQTT__TOPIC_PREFIX__HOMEASSISTANT__STATESTREAM",
default="homeassistant/statestream",
cast=str,
),
Validator(
"MQTT__USER",
default=None,
cast=str,
),
Validator(
"MQTT__PASSWORD",
default=None,
cast=str,
),
Validator(
"MQTT__KEEPALIVE",
default=60,
cast=int,
),
Validator(
"MQTT__LOG_MESSAGES",
default=False,
cast=bool,
),
# PATHS
Validator(
"PATHS__IMAGES",
default="images",
cast=Path,
),
]