Add logging for HDD temperature retrieval

This commit is contained in:
2025-02-05 13:59:41 +08:00
parent 4b01efc39b
commit fc0e89ee41

View File

@@ -1,6 +1,6 @@
import os import os
from .utilities import runCmd from .utilities import log, runCmd
def findHddIdInNt(): def findHddIdInNt():
@@ -37,6 +37,7 @@ def findHddTemp(hddDict):
for hddName in sorted(hddDict.keys()): for hddName in sorted(hddDict.keys()):
cmd = f"smartctl -A {hddName} | grep Temperature_Celsius" cmd = f"smartctl -A {hddName} | grep Temperature_Celsius"
hddTempString = runCmd(cmd) hddTempString = runCmd(cmd)
log.logI(f'hddTempString = {hddTempString}')
hddTempList = hddTempString.split(" ") hddTempList = hddTempString.split(" ")
hddTempList = [item for item in hddTempList if item != ""] hddTempList = [item for item in hddTempList if item != ""]
if len(hddTempList) > 9: if len(hddTempList) > 9: