Skip to content

Commit

Permalink
round temperatures
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed Dec 17, 2023
1 parent 0e6dbd8 commit 0e97d9c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions etc/dbus-serialbattery/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ def to_temp(self, sensor: int, value: float) -> None:
:return:
"""
if sensor == 0:
self.temp_mos = min(max(value, -20), 100)
self.temp_mos = round(min(max(value, -20), 100), 1)
if sensor == 1:
self.temp1 = min(max(value, -20), 100)
self.temp1 = round(min(max(value, -20), 100), 1)
if sensor == 2:
self.temp2 = min(max(value, -20), 100)
self.temp2 = round(min(max(value, -20), 100), 1)
if sensor == 3:
self.temp3 = min(max(value, -20), 100)
self.temp3 = round(min(max(value, -20), 100), 1)
if sensor == 4:
self.temp4 = min(max(value, -20), 100)
self.temp4 = round(min(max(value, -20), 100), 1)

def manage_charge_voltage(self) -> None:
"""
Expand Down

0 comments on commit 0e97d9c

Please sign in to comment.