Sort id of HDD & fan

This commit is contained in:
2024-03-27 10:45:50 +00:00
parent 2a609c5a21
commit f1e3cb3f9f

6
sysFanTemp.py Normal file → Executable file
View File

@@ -1,3 +1,5 @@
#!/usr/bin/python3
import hddtemp import hddtemp
import cpufantemp import cpufantemp
from rich.console import Console from rich.console import Console
@@ -40,7 +42,7 @@ def buildTable_HddTemperature():
"style": "magenta", "style": "magenta",
}, },
], ],
[[f"{hddKey}", f"{hddtempDict[hddKey].get('temp', -999.9)}°C"] for hddKey in hddtempDict.keys()] [[f"{hddKey}", f"{hddtempDict[hddKey].get('temp', -999.9)}°C"] for hddKey in sorted(hddtempDict.keys())]
) )
return table return table
@@ -82,7 +84,7 @@ def buildTable_FanSpeed():
"style": "magenta", "style": "magenta",
}, },
], ],
[[f"{fanKey}", f"{fanTempDict['fan'][fanKey]}"] for fanKey in fanTempDict["fan"].keys()] [[f"{fanKey}", f"{fanTempDict['fan'][fanKey]}"] for fanKey in sorted(fanTempDict["fan"].keys())]
) )
return table return table