From 1789bc51268547d579412925f5dbcc94b34e7293 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Thu, 7 Nov 2019 11:28:35 -0800 Subject: [PATCH] Fix fan control when not plugged into panda old-commit-hash: 3c6d8846ac46048272a7cfa453e96c509f31ab5b --- selfdrive/thermald.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/selfdrive/thermald.py b/selfdrive/thermald.py index 0886335e13..eeec3f3b11 100755 --- a/selfdrive/thermald.py +++ b/selfdrive/thermald.py @@ -189,11 +189,10 @@ def thermald_thread(): max_comp_temp = max(max_cpu_temp, msg.thermal.mem / 10., msg.thermal.gpu / 10.) bat_temp = msg.thermal.bat/1000. - if health is not None: - if health.health.hwType == log.HealthData.HwType.uno: - fan_speed = handle_fan_uno(max_cpu_temp, bat_temp, fan_speed) - else: - fan_speed = handle_fan_eon(max_cpu_temp, bat_temp, fan_speed) + if health is not None and health.health.hwType == log.HealthData.HwType.uno: + fan_speed = handle_fan_uno(max_cpu_temp, bat_temp, fan_speed) + else: + fan_speed = handle_fan_eon(max_cpu_temp, bat_temp, fan_speed) msg.thermal.fanSpeed = fan_speed