From 77d9a68f5d35b6c1d35992618a26a22f93d03bc6 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Wed, 21 Oct 2020 15:14:29 +0200 Subject: [PATCH] only log startup blocked on conditions changed (#2382) --- selfdrive/thermald/thermald.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 96bebdea8e..39e07c0dd7 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -180,6 +180,7 @@ def thermald_thread(): startup_conditions = { "ignition": False, } + startup_conditions_prev = startup_conditions.copy() off_ts = None started_ts = None @@ -376,7 +377,7 @@ def thermald_thread(): started_seen = True os.system('echo performance > /sys/class/devfreq/soc:qcom,cpubw/governor') else: - if startup_conditions["ignition"]: + if startup_conditions["ignition"] and (startup_conditions != startup_conditions_prev): cloudlog.event("Startup blocked", startup_conditions=startup_conditions) if should_start_prev or (count == 0): params.put("IsOffroad", "1") @@ -411,6 +412,7 @@ def thermald_thread(): set_offroad_alert_if_changed("Offroad_ChargeDisabled", (not usb_power)) should_start_prev = should_start + startup_conditions_prev = startup_conditions.copy() # report to server once per minute if (count % int(60. / DT_TRML)) == 0: