File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313"""
1414
1515import time
16- import board
1716import json
17+ import board
1818import displayio
1919from adafruit_pyportal import PyPortal
2020from adafruit_display_shapes .rect import Rect
@@ -50,7 +50,9 @@ def halt_and_catch_fire(message, *args):
5050 while True :
5151 pass
5252
53+ #pylint:disable=line-too-long
5354url = 'https://enviro.epa.gov/enviro/efservice/getEnvirofactsUVHOURLY/ZIP/{0}/JSON' .format (secrets ['zip' ])
55+ #pylint:enable=line-too-long
5456
5557def extract_hour (date_time ):
5658 split_date_time = date_time .split ()
@@ -81,8 +83,8 @@ def extract_date(date_time):
8183while True :
8284 raw_data = json .loads (pyportal .fetch ())
8385 data = [{'hour' : extract_hour (d ['DATE_TIME' ]), 'value' : int (d ['UV_VALUE' ])}
84- for d in raw_data
85- if d ['UV_VALUE' ] > 0 ]
86+ for d in raw_data
87+ if d ['UV_VALUE' ] > 0 ]
8688 the_day = raw_data [0 ]['DATE_TIME' ]
8789 pyportal .set_caption ('UV Index for {0}' .format (extract_date (the_day )),
8890 (80 , 20 ),
You can’t perform that action at this time.
0 commit comments