1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-09 23:15:38 -05:00

second path to enable GPU temps

This commit is contained in:
bbedward
2025-08-09 10:53:17 -04:00
parent 44277cd0f3
commit a0c5f31ffa
4 changed files with 453 additions and 413 deletions

View File

@@ -294,7 +294,12 @@ Singleton {
}
function updateGpuTemperatures(tempData) {
if (availableGpus.length === 0 || tempData.length === 0) return
if (availableGpus.length === 0) return
if (!gpuTempEnabled || tempData.length === 0) {
clearGpuTemperatures()
return
}
const updatedGpus = []
for (let i = 0; i < availableGpus.length; i++) {
@@ -325,6 +330,25 @@ Singleton {
availableGpus = updatedGpus
}
function clearGpuTemperatures() {
if (availableGpus.length === 0) return
const clearedGpus = []
for (let i = 0; i < availableGpus.length; i++) {
const gpu = availableGpus[i]
clearedGpus.push({
"driver": gpu.driver,
"vendor": gpu.vendor,
"displayName": gpu.displayName,
"fullName": gpu.fullName,
"pciId": gpu.pciId,
"temperature": 0,
"hwmon": "unknown"
})
}
availableGpus = clearedGpus
}
function parseUnifiedStats(text) {
function num(x) {
return (typeof x === "number" && !isNaN(x)) ? x : 0