forked from rbitting/pi-display
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
58 lines (51 loc) · 1.73 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
from dotenv import load_dotenv
from PIL import ImageFont
from utils.epd4in2 import EPD_HEIGHT, EPD_WIDTH
from utils.util_os import get_absolute_path, get_env_var
load_dotenv()
WEATHER_ENV_VAR = "OWM_API_KEY"
GCAL_ENV_VAR = "GOOGLE_CALENDAR_ID"
LOCATION_LAT, LOCATION_LON = get_env_var("LOCATION_LAT_LON").split(",")
weather = {
"enabled": True,
"api_key": get_env_var(WEATHER_ENV_VAR),
"env_var": WEATHER_ENV_VAR,
"lon": LOCATION_LON,
"lat": LOCATION_LAT,
"units": "metric", # 'standard', 'metric' or 'imperial'
}
last_fm = {
"api_key": get_env_var("LAST_FM_API_KEY"),
"user_name": get_env_var("LAST_FM_USERNAME"),
}
google_cal = {"enabled": False, "cal_id": get_env_var(GCAL_ENV_VAR)}
FONT_SM_SIZE = 15
FONT_MD_SIZE = 18
FONT_LG_SIZE = 30
FONT_ITALIC_SM = ImageFont.truetype(
get_absolute_path("assets/fonts/Roboto-Italic.ttf"), FONT_SM_SIZE
)
FONT_ITALIC = ImageFont.truetype(
get_absolute_path("assets/fonts/Roboto-Italic.ttf"), FONT_MD_SIZE
)
# FONT_SM = ImageFont.truetype(get_absolute_path(
# 'assets/fonts/Roboto-Regular.ttf'), FONT_SM_SIZE)
# FONT_MD = ImageFont.truetype(get_absolute_path('assets/fonts/Roboto-Regular.ttf'), FONT_MD_SIZE)
FONT_SM = ImageFont.truetype(
get_absolute_path("assets/fonts/Alegreya-Regular.ttf"), FONT_SM_SIZE
)
FONT_MD = ImageFont.truetype(
get_absolute_path("assets/fonts/Alegreya-Regular.ttf"), FONT_MD_SIZE
)
FONT_LG = ImageFont.truetype(
get_absolute_path("assets/fonts/Roboto-Regular.ttf"), FONT_LG_SIZE
)
FONT_PIXEL = ImageFont.truetype(
get_absolute_path("assets/fonts/SUBWT.ttf"), FONT_MD_SIZE
)
ICON_SIZE_SM = 40
ICON_SIZE_XS = 18
PADDING = 10
PADDING_SM = PADDING / 2
DISPLAY_W = EPD_HEIGHT # Flipped because display is rotated
DISPLAY_H = EPD_WIDTH