Merge pull request #15 from Meliox/integration-eremem
Remove "?" behind CPU temp. if no core index found in sensors output
This commit is contained in:
commit
3d030b8383
@ -225,10 +225,17 @@ function install_mod {
|
||||
try {\n\
|
||||
Object.keys(items[coreKey]).forEach((secondLevelKey) => {\n\
|
||||
if (secondLevelKey.includes('_input')) {\n\
|
||||
let tempStr = '';\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\
|
||||
if(index !== null && index.length > 1) {\n\
|
||||
index = index[1];\n\
|
||||
tempStr = \`\${cpuTempCaption} \${index}: \${temp}°C\`;\n\
|
||||
}\n\
|
||||
else {\n\
|
||||
tempStr = \`\${cpuTempCaption}: \${temp}°C\`;\n\
|
||||
}\n\
|
||||
temps.push(tempStr);\n\
|
||||
}\n\
|
||||
})\n\
|
||||
} catch(e) { /*_*/ }\n\
|
||||
@ -412,4 +419,4 @@ done
|
||||
# If no arguments were provided or all arguments have been processed, print the usage message
|
||||
if [[ $executed -eq 0 ]]; then
|
||||
usage
|
||||
fi
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user