Controls - Device Management - Device Shutdown Timer

Configure how quickly the device shuts down after going offroad.
This commit is contained in:
FrogAi 2024-05-10 11:15:26 -07:00
parent 28fb8de134
commit 4fb348ec6d

View File

@ -116,7 +116,7 @@ class PowerMonitoring:
offroad_time = (now - offroad_timestamp) offroad_time = (now - offroad_timestamp)
low_voltage_shutdown = (self.car_voltage_mV < (VBATT_PAUSE_CHARGING * 1e3) and low_voltage_shutdown = (self.car_voltage_mV < (VBATT_PAUSE_CHARGING * 1e3) and
offroad_time > VOLTAGE_SHUTDOWN_MIN_OFFROAD_TIME_S) offroad_time > VOLTAGE_SHUTDOWN_MIN_OFFROAD_TIME_S)
should_shutdown |= offroad_time > MAX_TIME_OFFROAD_S should_shutdown |= offroad_time > frogpilot_toggles.device_shutdown_time
should_shutdown |= low_voltage_shutdown should_shutdown |= low_voltage_shutdown
should_shutdown |= (self.car_battery_capacity_uWh <= 0) should_shutdown |= (self.car_battery_capacity_uWh <= 0)
should_shutdown &= not ignition should_shutdown &= not ignition