Initial commit

This commit is contained in:
Joan
2025-12-31 11:42:15 +01:00
parent 88d2bce132
commit 04cd96b1af
11 changed files with 638 additions and 0 deletions

17
netdata.py Normal file
View 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