Round system overheated temperature (#24544)

* Update events.py

* Apply suggestions from code review

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 961a121fde
taco
Shane Smiskol 3 years ago committed by GitHub
parent 599d52ded2
commit 19aebce4f2
  1. 2
      selfdrive/controls/lib/events.py

@ -264,7 +264,7 @@ def overheat_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, sof
cpu = max(sm['deviceState'].cpuTempC, default=0.) cpu = max(sm['deviceState'].cpuTempC, default=0.)
gpu = max(sm['deviceState'].gpuTempC, default=0.) gpu = max(sm['deviceState'].gpuTempC, default=0.)
temp = max((cpu, gpu, sm['deviceState'].memoryTempC)) temp = max((cpu, gpu, sm['deviceState'].memoryTempC))
return NormalPermanentAlert("System Overheated", f"{temp} °C") return NormalPermanentAlert("System Overheated", f"{temp:.0f} °C")
def low_memory_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert: def low_memory_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert:

Loading…
Cancel
Save