Skip to content

Commit

Permalink
Round system overheated temperature (commaai#24544)
Browse files Browse the repository at this point in the history
* Update events.py

* Apply suggestions from code review

Co-authored-by: Willem Melching <willem.melching@gmail.com>
  • Loading branch information
2 people authored and rjsmith1999 committed Jun 26, 2022
1 parent 9634dbb commit 002f056
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion selfdrive/controls/lib/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def overheat_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, sof
cpu = max(sm['deviceState'].cpuTempC, default=0.)
gpu = max(sm['deviceState'].gpuTempC, default=0.)
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:
Expand Down

0 comments on commit 002f056

Please sign in to comment.