From 315665434d228690214a83c255d6cc2aea9dcc51 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Fri, 14 Jan 2022 13:54:21 +0100 Subject: [PATCH 1/2] thermald: let manager handle shutdown --- selfdrive/thermald/thermald.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 44facfbc59730e..91a3c7e188e6d4 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 @@ -392,9 +391,7 @@ 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() + params.put_bool("DoShutdown", True) # If UI has crashed, set the brightness to reasonable non-zero value ui_running = "ui" in (p.name for p in sm["managerState"].processes if p.running) From 568456f4660915a0fe0ff05c77b6922ad1541931 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Fri, 14 Jan 2022 14:05:54 +0100 Subject: [PATCH 2/2] add warning so its actually sent --- selfdrive/thermald/thermald.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 91a3c7e188e6d4..70483a5024e65b 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -390,7 +390,7 @@ 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}") + cloudlog.warning(f"shutting device down, offroad since {off_ts}") params.put_bool("DoShutdown", True) # If UI has crashed, set the brightness to reasonable non-zero value