CPU temperature indices follow the sensors output

This commit is contained in:
rmm 2023-07-04 19:47:15 +02:00
parent 319bcb1cec
commit d92856d192

View File

@ -218,11 +218,13 @@ function install_mod {
const items = objValue[cpuAddress],\n\ const items = objValue[cpuAddress],\n\
itemKeys = Object.keys(items).filter(item => { return String(item).startsWith(cpuItemPrefix); });\n\ itemKeys = Object.keys(items).filter(item => { return String(item).startsWith(cpuItemPrefix); });\n\
let temps = [];\n\ let temps = [];\n\
itemKeys.forEach((coreKey, index) => {\n\ itemKeys.forEach((coreKey) => {\n\
try {\n\ try {\n\
Object.keys(items[coreKey]).forEach((secondLevelKey) => {\n\ Object.keys(items[coreKey]).forEach((secondLevelKey) => {\n\
if (secondLevelKey.includes('_input')) {\n\ if (secondLevelKey.includes('_input')) {\n\
let temp = items[coreKey][secondLevelKey];\n\ let temp = items[coreKey][secondLevelKey];\n\
let index = coreKey.match(/\\\S+\\\s*(\\\d+)/);\n\
index = (index !== null && index.length > 1) ? index[1] : '?';\n\
temps.push(\`\${cpuTempCaption} \${index}: \${temp}°C\`);\n\ temps.push(\`\${cpuTempCaption} \${index}: \${temp}°C\`);\n\
}\n\ }\n\
})\n\ })\n\