From 2476ea213c24dac16531c8798761e34f96e0ded2 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 19 Aug 2020 12:34:49 -0700 Subject: [PATCH] clip carBatteryCapacity to 0 --- 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 b17bd72f29..d70625c792 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -403,7 +403,7 @@ def thermald_thread(): # Offroad power monitoring pm.calculate(health) msg.thermal.offroadPowerUsage = pm.get_power_used() - msg.thermal.carBatteryCapacity = pm.get_car_battery_capacity() + msg.thermal.carBatteryCapacity = max(0, pm.get_car_battery_capacity()) # Check if we need to disable charging (handled by boardd) msg.thermal.chargingDisabled = pm.should_disable_charging(health, off_ts)