Skip to content

Commit 533af2e

Browse files
committed
Catch the possible OSErrors while writing duty
1 parent 70911e1 commit 533af2e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

hardwareServer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ async def updateInfo():
161161
if t == "Temperature" and n == "Liquid":
162162
formatted["kraken"]["liquidTemperature"] = sensor["Value"]
163163
if t == "Fan" and n == "Fans":
164+
# Nobody has more than one CPU right?
164165
formatted["cpus"][0]["fanSpeed"] = sensor["Value"]
165166
formatted["cpus"][0]["minFanSpeed"] = sensor["Min"]
166167
formatted["cpus"][0]["maxFanSpeed"] = sensor["Max"]
@@ -187,7 +188,10 @@ async def updateDuty(channel, temp, criticalTemp):
187188
average = ema
188189
duty = interpolateProfile(norm, ema)
189190
#print(f"[HARDWARE-SERVER] Setting {channel} duty to {duty}%")
190-
await lcd.setFixedSpeed(channel, duty)
191+
try:
192+
await lcd.setFixedSpeed(channel, duty)
193+
except OSError:
194+
print(f"[HARDWARE-SERVER] There was an error while writing duty info for {channel}")
191195

192196
async def checkCurves(cpuTemp, gpuTemp, liquidTemp):
193197
global config, cpuTemps

0 commit comments

Comments
 (0)