Fix possible error

This commit is contained in:
2024-03-25 15:29:52 +00:00
parent ea23feb443
commit eb9ef8abe2

View File

@@ -37,8 +37,9 @@ def main():
## HDD temp on right ## HDD temp on right
hddTempString = "" hddTempString = ""
print(hddtempDict)
for hddname in sorted(hddtempDict.keys()): for hddname in sorted(hddtempDict.keys()):
temp = hddtempDict[hddname]["temp"] temp = hddtempDict[hddname].get("temp", -999.9)
hddTempString += f"{hddname}: {temp}°C\n" hddTempString += f"{hddname}: {temp}°C\n"
p = Panel(hddTempString, title="HDD Temperature") p = Panel(hddTempString, title="HDD Temperature")
p.height = 15 p.height = 15