wip
This commit is contained in:
parent
69ee52cfa7
commit
824d6854f5
2 changed files with 32 additions and 0 deletions
5
requirements.txt
Normal file
5
requirements.txt
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
numpy
|
||||||
|
matplotlib
|
||||||
|
soundfile
|
||||||
|
scipy
|
||||||
|
requests
|
27
temp_test.py
Executable file
27
temp_test.py
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import requests
|
||||||
|
import urllib3
|
||||||
|
import datetime
|
||||||
|
urllib3.disable_warnings()
|
||||||
|
|
||||||
|
HUE_IP = "10.0.0.134" # replace with your bridge IP
|
||||||
|
HUE_APP_KEY = "03zr5DYHpzKu1l501uzdcHMClkUXsAntHJp2Y7JO" # local only
|
||||||
|
HUE_DEVICE_ID = "31f58786-3242-4e88-b9ce-23f44ba27bbe"
|
||||||
|
|
||||||
|
response = requests.get(
|
||||||
|
f"https://{HUE_IP}/clip/v2/resource/temperature",
|
||||||
|
headers={"hue-application-key": HUE_APP_KEY},
|
||||||
|
verify=False,
|
||||||
|
)
|
||||||
|
response.raise_for_status()
|
||||||
|
data = response.json()
|
||||||
|
|
||||||
|
for item in data["data"]:
|
||||||
|
if item["id"] == HUE_DEVICE_ID:
|
||||||
|
temperature = item["temperature"]["temperature"]
|
||||||
|
temperature_date_string = item["temperature"]["temperature_report"]["changed"]
|
||||||
|
temperature_date = datetime.datetime.fromisoformat(temperature_date_string)
|
||||||
|
break
|
||||||
|
|
||||||
|
print(f"{temperature}°C @{temperature_date}")
|
Loading…
Reference in a new issue