From d3063e9a0a42fc4ed967ada68757ceaeb011b1d5 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 7 Dec 2024 15:15:49 -0800 Subject: [PATCH] hardwared: allow empty temp fields --- system/hardware/hardwared.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/hardware/hardwared.py b/system/hardware/hardwared.py index e9b645691c..48c916b146 100755 --- a/system/hardware/hardwared.py +++ b/system/hardware/hardwared.py @@ -230,13 +230,13 @@ def hardware_thread(end_event, hw_queue) -> None: # this subset is only used for offroad temp_sources = [ msg.deviceState.memoryTempC, - max(msg.deviceState.cpuTempC), - max(msg.deviceState.gpuTempC), + max(msg.deviceState.cpuTempC, default=0.), + max(msg.deviceState.gpuTempC, default=0.), ] offroad_comp_temp = offroad_temp_filter.update(max(temp_sources)) # this drives the thermal status while onroad - temp_sources.append(max(msg.deviceState.pmicTempC)) + temp_sources.append(max(msg.deviceState.pmicTempC, default=0.)) all_comp_temp = all_temp_filter.update(max(temp_sources)) msg.deviceState.maxTempC = all_comp_temp