-
-
Notifications
You must be signed in to change notification settings - Fork 25
02 Configuration
lovebootcaptain edited this page Jun 30, 2020
·
2 revisions
- go to weatherbit.io
- and register to get an API key
when your Pi has rebooted
cd
cd WeatherPi_TFT
cp example.config.json config.jsonnano config.json
"DISPLAY": {
"WIDTH": 240,
"HEIGHT": 320,
"FPS": 30,
"AA": false,
"ANIMATION": false,
"FRAMEBUFFER": "/dev/fb1",
"PWM": false,
"SHOW_FPS": true,
"SHOW_API_STATS": true,
"MOUSE": true
},
- as long as you configure a 3:4 ratio the dashboard will be scaled
-
FPSis used for pygame internal ticks - 30 fps is more than enough to render clock transitions and precipitation animations smoothly -
AAturns antialiasing on and off (leave it on a Pi Zero off, it is performance heavy on higher FPS) -
ANIMATIONenables the little particle simulation for precipitation, disable will show an image instead - set
FRAMEBUFFERaccording to your display, some use fb0 (e.g. @pimoroni HyperPixel4) some fb1 (most ili9341 from @adafruit), for local development or HDMI displays set it tofalse - set
PWMto your GPIO pin if your display support pwm brightness (HyperPixel supports GPIO 19 for pwm brightness) - may need some code adjustments on your side depending on your display (some are bright enough with pwm 25, some ore not) otherwise set it tofalse -
SHOW_FPSshow the current fps on the display -
SHOW_API_STATSshow how many API calls are left over (resets every midnight UTC) -
MOUSEenable/disable mouse pointer - needed for local development, better leave it disabled
- replace
xxxxxxxxxxxxxxxxxxxxxxxxxin"WEATHERBIT_IO_KEY": "xxxxxxxxxxxxxxxxxxxxxxxxx"with your own API key - replace
enin"WEATHERBIT_LANGUAGE": "en"with your preferred language - replace
dein"WEATHERBIT_COUNTRY": "de"with your country - replace
10178in"WEATHERBIT_POSTALCODE": 10178with your zip code / postal code (this example-location zip code is from berlin city, germany) - for language-support, units, etc please refer to -> weatherbit API Docs
"LOCALE": {
"ISO": "en_GB",
"RAIN_STR": "Rain",
"SNOW_STR": "Snow",
"PRECIP_STR": "Precipitation",
"METRIC": true
},
- change
"ISO"and"METRIC"according to your needs -
"METRIC": truewill get all weather data units as metric system, change tofalseif you prefer imperial styled units-
°Cwill be°Fandkm/hwill be `mph - will also change the request parameter
untisfor the api request (see weatherbit API Docs for more details)
-
"TIMER": {
"UPDATE": 420,
"RELOAD": 30
},
- the
UPDATEtimer defines how often the API will be called in seconds - 7min will give you enough API calls over the day -
RELOADdefines who often the information on the display will be updated
set your theme file [darcula.theme, light.theme or example.theme] in config.json
"THEME": "darcula.theme",
- inside your THEME you can specify with json file with theming information -> an example for the default theme is in the file
example.theme.json - you must also try the new
darcula.theme.jsonwhich is an homage to jetBrains great darcula theme for their IDE's -> see screenshots below- you can change some basic theme information
- change colors of status bar icons and the wind direction icon with the theme colors
"RED" is used for errors in status bar icons and wind direction "BLUE" is used for sync and update in status bar icons and rain precip icon "GREEN" is used for everything fine in status bar icons - change every color of an image by adding a color
(r, g, b)to the optionalfillcolorparameter in theDrawImageclass - change the time and date format according to your preferences
- a good reference for strftime options can be found here Python strftime()
- for 12h clock with am and pm support you can use
"%I:%M:%S %p"instead of"%H:%M:%S"for a 24h clock inyourTheme.DATE_FORMAT.TIME - for imperial like date format just change
"%A - %d. %b %Y"to"%A - %b %d %Y"inyourTheme.DATE_FORMAT.DATE
- or create your own theme with your fonts and add it to your config/theme`