You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
385 B
19 lines
385 B
import requests
|
|
|
|
url = "http://localhost:8000/api/data"
|
|
|
|
response = requests.get(url)
|
|
|
|
if response.status_code == 200:
|
|
data = response.json()
|
|
print(data)
|
|
else:
|
|
print("Chyba:", response.status_code)
|
|
|
|
teplota = data["teplota"]
|
|
print(f"Teplota: {teplota}°C")
|
|
vlhkost = data["vlhkost"]
|
|
print(f"Vlhkost: {vlhkost}%")
|
|
led_stav = data["led_stav"]
|
|
print(f"Stav LED: {led_stav}")
|
|
|
|
|