From 0072f71fb417e85b326fa5c17f70e70a0f1bd60e Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Wed, 17 Mar 2021 14:19:55 +0100 Subject: [PATCH] only do hardware supported check if PandaState is not None (#20385) --- selfdrive/thermald/thermald.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 362e5ecb55..01268346d0 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -208,6 +208,10 @@ def thermald_thread(): no_panda_cnt = 0 startup_conditions["ignition"] = pandaState.pandaState.ignitionLine or pandaState.pandaState.ignitionCan + startup_conditions["hardware_supported"] = pandaState.pandaState.pandaType not in [log.PandaState.PandaType.whitePanda, + log.PandaState.PandaType.greyPanda] + set_offroad_alert_if_changed("Offroad_HardwareUnsupported", not startup_conditions["hardware_supported"]) + # Setup fan handler on first connect to panda if handle_fan is None and pandaState.pandaState.pandaType != log.PandaState.PandaType.unknown: is_uno = pandaState.pandaState.pandaType == log.PandaState.PandaType.uno @@ -347,10 +351,6 @@ def thermald_thread(): startup_conditions["device_temp_good"] = thermal_status < ThermalStatus.danger set_offroad_alert_if_changed("Offroad_TemperatureTooHigh", (not startup_conditions["device_temp_good"])) - startup_conditions["hardware_supported"] = pandaState is not None and pandaState.pandaState.pandaType not in [log.PandaState.PandaType.whitePanda, - log.PandaState.PandaType.greyPanda] - set_offroad_alert_if_changed("Offroad_HardwareUnsupported", pandaState is not None and not startup_conditions["hardware_supported"]) - # Handle offroad/onroad transition should_start = all(startup_conditions.values()) if should_start: