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 spektor56 committed May 19, 2022
1 parent 989ade6 commit 7d7ee6e
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 @@ -264,7 +264,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 7d7ee6e

Please sign in to comment.