From 53ca0360061ca890a5354650fdc06b0bb42d3b9b Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Fri, 14 Jan 2022 14:13:32 +0100 Subject: [PATCH] thermald: let manager handle shutdown (#23528) * thermald: let manager handle shutdown * add warning so its actually sent --- selfdrive/thermald/thermald.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index dcf7bd8f69..efec437d0f 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 import datetime import os -import time from pathlib import Path from typing import Dict, NoReturn, Optional, Tuple from collections import namedtuple, OrderedDict @@ -373,10 +372,8 @@ def thermald_thread() -> NoReturn: # Check if we need to shut down if power_monitor.should_shutdown(peripheralState, onroad_conditions["ignition"], in_car, off_ts, started_seen): - cloudlog.info(f"shutting device down, offroad since {off_ts}") - # TODO: add function for blocking cloudlog instead of sleep - time.sleep(10) - HARDWARE.shutdown() + cloudlog.warning(f"shutting device down, offroad since {off_ts}") + params.put_bool("DoShutdown", True) msg.deviceState.chargingError = current_filter.x > 0. and msg.deviceState.batteryPercent < 90 # if current is positive, then battery is being discharged msg.deviceState.started = started_ts is not None