Skip to content

Commit 704ed23

Browse files
authored
Display CPU temperature
The temperature command was set up but not executed or used for display
1 parent 4a2591a commit 704ed23

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Pi_Hole_Ad_Blocker/mini_pitft_stats.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@
8585
cmd = "df -h | awk '$NF==\"/\"{printf \"Disk: %d/%d GB %s\", $3,$2,$5}'"
8686
Disk = subprocess.check_output(cmd, shell=True).decode("utf-8")
8787
cmd = "cat /sys/class/thermal/thermal_zone0/temp | awk \'{printf \"CPU Temp: %.1f C\", $(NF-0) / 1000}\'" # pylint: disable=line-too-long
88+
Temp = subprocess.check_output(cmd, shell=True).decode("utf-8")
89+
8890

8991
# Pi Hole data!
9092
try:
@@ -107,7 +109,8 @@
107109
y += font.getsize(MemUsage)[1]
108110
draw.text((x, y), Disk, font=font, fill="#0000FF")
109111
y += font.getsize(Disk)[1]
110-
draw.text((x, y), "DNS Queries: {}".format(DNSQUERIES), font=font, fill="#FF00FF")
112+
draw.text((x, y), Temp, font=font, fill="#FF00FF")
113+
y += font.getsize(Temp)[1]
111114
else:
112115
draw.text((x, y), IP, font=font, fill="#FFFF00")
113116
y += font.getsize(IP)[1]

0 commit comments

Comments
 (0)