File tree Expand file tree Collapse file tree
PyPortal/PyPortal_AirQuality Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77the number of followers... and display it on a screen!
88if you can find something that spits out JSON data, we can display it
99"""
10+ import os
1011import time
1112import board
1213from adafruit_pyportal import PyPortal
1314
14- # Get wifi details and more from a secrets.py file
15- try :
16- from secrets import secrets
17- except ImportError :
18- print ("WiFi secrets are kept in secrets.py, please add them there!" )
19- raise
20-
2115# Change this to your zip code, not all locations have AQI data. Check
2216# https://airnow.gov/ to see if there's data available!
2317LOCATION = "90210"
2418
2519# Set up where we'll be fetching data from
2620DATA_SOURCE = "http://www.airnowapi.org/aq/forecast/zipCode/?format=application/json"
2721# You'll need to get a token from airnow.gov, looks like '4d36e978-e325-11cec1-08002be10318'
28- DATA_SOURCE += "&zipCode=" + LOCATION + "&API_KEY=" + secrets [ 'airnow_token' ]
22+ DATA_SOURCE += "&zipCode=" + LOCATION + "&API_KEY=" + os . getenv ( "AIRNOW_TOKEN" )
2923DATA_LOCATION = [1 , "AQI" ]
3024
3125# the current working directory (where this file is)
You can’t perform that action at this time.
0 commit comments