Skip to content
Snippets Groups Projects
Verified Commit 77e67cea authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Read outside temp

parent 59d2743b
No related branches found
No related tags found
No related merge requests found
......@@ -81,7 +81,22 @@ if __name__ == "__main__":
lcd.cursor_pos = (0, 0)
json_body = []
# Outdoor temp
r = requests.get("http://api.openweathermap.org/data/2.5/weather?q=Luebeck,de&appid=890cda16c75a675e1fce4eed7a8d896f")
data = r.json()
temp_out = data["main"]["temp"] - 273.15
json_body.append({
"measurement": f"temp_outside",
"tags": tags,
"fields": {
"value": temp_out
}
})
########
# TEMP #
########
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment