Initial commit
This commit is contained in:
17
netdata.py
Normal file
17
netdata.py
Normal file
@@ -0,0 +1,17 @@
|
||||
"""
|
||||
Netdata API client for Matrix64 LED display.
|
||||
"""
|
||||
import requests
|
||||
from config import NETDATA_URL
|
||||
|
||||
|
||||
def get_hdd_temps():
|
||||
"""Get HDD temperatures from Netdata."""
|
||||
try:
|
||||
url = f"{NETDATA_URL}/api/v2/data?contexts=hddtemp.disk_temperature&points=1&group_by=instance"
|
||||
response = requests.get(url, timeout=10)
|
||||
hdd_temps = response.json()['result']['data'][0]
|
||||
return hdd_temps
|
||||
except Exception as e:
|
||||
print(f"Error fetching HDD temps: {e}")
|
||||
return None
|
||||
Reference in New Issue
Block a user