Skip to content

Commit 389d364

Browse files
authored
Merge pull request #1048 from ehershey/patch-1
Display CPU temperature in pihole stats script
2 parents 1a6049f + ad3a0da commit 389d364

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Pi_Hole_Ad_Blocker/mini_pitft_stats.py

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

9496
# Pi Hole data!
9597
try:
@@ -112,7 +114,8 @@
112114
y += font.getsize(MemUsage)[1]
113115
draw.text((x, y), Disk, font=font, fill="#0000FF")
114116
y += font.getsize(Disk)[1]
115-
draw.text((x, y), "DNS Queries: {}".format(DNSQUERIES), font=font, fill="#FF00FF")
117+
draw.text((x, y), Temp, font=font, fill="#FF00FF")
118+
y += font.getsize(Temp)[1]
116119
else:
117120
draw.text((x, y), IP, font=font, fill="#FFFF00")
118121
y += font.getsize(IP)[1]

0 commit comments

Comments
 (0)