From 2629715097c94b11ceec2a2a5fae7daca957e42e Mon Sep 17 00:00:00 2001 From: Igor Biletskyy Date: Mon, 7 Feb 2022 14:32:29 -0800 Subject: [PATCH] thermald: accept ignition from any panda (#23721) * ignition from any panda * more elegant ) Co-authored-by: Adeeb Shihadeh * typo Co-authored-by: Adeeb Shihadeh --- selfdrive/thermald/thermald.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 6cbb8ee89..113ffaa04 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -251,10 +251,11 @@ def thermald_thread(end_event, hw_queue): msg = read_thermal(thermal_config) if sm.updated['pandaStates'] and len(pandaStates) > 0: - pandaState = pandaStates[0] - if pandaState.pandaType != log.PandaState.PandaType.unknown: - onroad_conditions["ignition"] = pandaState.ignitionLine or pandaState.ignitionCan + # Set ignition based on any panda connected + onroad_conditions["ignition"] = any(ps.ignitionLine or ps.ignitionCan for ps in pandaStates if ps.pandaType != log.PandaState.PandaType.unknown) + + pandaState = pandaStates[0] in_car = pandaState.harnessStatus != log.PandaState.HarnessStatus.notConnected usb_power = peripheralState.usbPowerMode != log.PeripheralState.UsbPowerMode.client