make sure socket is closed
This commit is contained in:
parent
50b8e2ef90
commit
d5e1a2d8a0
|
@ -88,7 +88,6 @@ def get_data():
|
|||
# open the json data
|
||||
j = r.json()
|
||||
print("Data obtained!")
|
||||
r.close()
|
||||
|
||||
# parse relevant data from JSON
|
||||
current = j["current_weather"]
|
||||
|
@ -101,6 +100,8 @@ Conditions = {WEATHERCODES[weathercode]}
|
|||
Last Open-Meteo update: {datetime_arr[0]}, {datetime_arr[1]}
|
||||
""")
|
||||
|
||||
r.close()
|
||||
|
||||
# flash the onboard LED after getting data
|
||||
pico_led.value(True)
|
||||
time.sleep(0.2)
|
||||
|
|
Loading…
Reference in New Issue