Skip to content

Commit e853540

Browse files
committed
Restore other config.yaml fields to their default values to avoid conflicts
Rename weather keys in config.yaml
1 parent 9f2441e commit e853540

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

config.yaml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
---
12
config:
23
# Configuration values to set up basic communication
34
# Set your COM port e.g. COM3 for Windows, /dev/ttyACM0 for Linux...
45
# Use AUTO for COM port auto-discovery (may not work on every setup)
56
# COM_PORT: "/dev/ttyACM0"
67
# COM_PORT: "COM3"
7-
COM_PORT: AUTO
8+
COM_PORT: "AUTO"
89

910
# Theme to use (located in res/themes)
1011
# Use the name of the folder as value
11-
THEME: ColoredFlat
12+
THEME: 3.5inchTheme2
1213

1314
# Hardware sensors reading
1415
# Choose the appropriate method for reading your hardware sensors:
@@ -22,21 +23,8 @@ config:
2223
# Linux/MacOS interfaces are named "eth0", "wlan0", "wlp1s0", "enp2s0"...
2324
# For Windows use the interfaces pretty name: "Ethernet 2", "Wi-Fi", ...
2425
# Leave the fields empty if the card does not exist on your setup
25-
ETH: Ethernet # Ethernet Card
26-
WLO: Wi-Fi # Wi-Fi Card
27-
28-
# Used to calculate your ping.
29-
PING: 8.8.8.8
30-
31-
# For weather, you can use for example https://www.latlong.net/
32-
LATITUDE: 45.75
33-
LONGITUDE: 4.85
34-
# OpenWeatherMap API KEY. Can be obtained by creating a free account on https://home.openweathermap.org/users/sign_up. You need to subscreibe to the 3.0 OneCallAPI that has 1000 free daily calls
35-
API_KEY: abcdef
36-
# Units used to display temperatures (metric - °C, imperial - °F, standard - °K)
37-
WEATHER_UNITS: metric
38-
# Language is used by the API. Find more here https://openweathermap.org/api/one-call-3#multi
39-
LANGUAGE: fr
26+
ETH: "" # Ethernet Card
27+
WLO: "" # Wi-Fi Card
4028

4129
# CPU fan
4230
# For Linux/MacOS platforms, the CPU fan is amongst all fan sensors gathered from the motherboard chipset
@@ -45,6 +33,21 @@ config:
4533
# Value must be 'controller/fan' e.g. 'nct6798/fan2'. Use configuration wizard for help in selection
4634
CPU_FAN: AUTO
4735

36+
# IP address used for ping sensor. Can be external (e.g. 8.8.8.8) or internal (e.g. 192.168.x.x)
37+
PING: 8.8.8.8
38+
39+
# Weather data with OpenWeatherMap API. Only useful if you want to use a theme that displays it
40+
# Location from which to display the weather. Use for example https://www.latlong.net/ to get latitude/longitude
41+
WEATHER_LATITUDE: 45.75
42+
WEATHER_LONGITUDE: 4.85
43+
# OpenWeatherMap API KEY. Can be obtained by creating a free account on https://home.openweathermap.org/users/sign_up.
44+
# You need to subscribe to the 3.0 OneCallAPI that has 1000 free daily calls
45+
WEATHER_API_KEY: ""
46+
# Units used to display temperatures (metric - °C, imperial - °F, standard - °K)
47+
WEATHER_UNITS: metric
48+
# Language is used by the API. Find more here https://openweathermap.org/api/one-call-3#multi
49+
WEATHER_LANGUAGE: fr
50+
4851
display:
4952
# Display revision:
5053
# - A for Turing 3.5" and UsbPCMonitor 3.5"/5"

library/stats.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -856,11 +856,11 @@ def stats():
856856
desc = "x"*center_description_length
857857
else:
858858
# API Parameters
859-
lat = config.CONFIG_DATA['config'].get('LATITUDE', "")
860-
lon = config.CONFIG_DATA['config'].get('LONGITUDE', "")
861-
api_key = config.CONFIG_DATA['config'].get('API_KEY', "")
859+
lat = config.CONFIG_DATA['config'].get('WEATHER_LATITUDE', "")
860+
lon = config.CONFIG_DATA['config'].get('WEATHER_LONGITUDE', "")
861+
api_key = config.CONFIG_DATA['config'].get('WEATHER_API_KEY', "")
862862
units = config.CONFIG_DATA['config'].get('WEATHER_UNITS', "metric")
863-
lang = config.CONFIG_DATA['config'].get('LANGUAGE', "en")
863+
lang = config.CONFIG_DATA['config'].get('WEATHER_LANGUAGE', "en")
864864
deg = WEATHER_UNITS.get(units, '°?')
865865
if api_key:
866866
url = f'https://api.openweathermap.org/data/3.0/onecall?lat={lat}&lon={lon}&exclude=minutely,hourly,daily,alerts&appid={api_key}&units={units}&lang={lang}'

0 commit comments

Comments
 (0)