1
0
şunun yansıması https://github.com/karl0ss/homepage.git eşitlendi 2025-10-20 10:13:59 +01:00

Handle sensors without warning property

Bu işleme şunda yer alıyor:
shamoon 2023-07-20 14:40:27 -07:00
ebeveyn dfa9e3b8fa
işleme 60fa4205d3

Dosyayı Görüntüle

@ -50,7 +50,7 @@ export default function Widget({ options }) {
if (options.cputemp && cpuSensors) {
try {
mainTemp = cpuSensors.reduce((acc, s) => acc + s.value, 0) / cpuSensors.length;
maxTemp = Math.max(cpuSensors.reduce((acc, s) => acc + s.warning, 0) / cpuSensors.length, maxTemp);
maxTemp = Math.max(cpuSensors.reduce((acc, s) => acc + (s.warning > 0 ? s.warning : 0), 0) / cpuSensors.length, maxTemp);
if (unit === "fahrenheit") {
mainTemp = convertToFahrenheit(mainTemp);
maxTemp = convertToFahrenheit(maxTemp);