Skip to content

Commit

Permalink
fix K to C conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
tillsteinbach committed Oct 27, 2023
1 parent a5687ee commit 12ef902
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion weconnect/elements/temperature_battery_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from weconnect.addressable import AddressableAttribute
from weconnect.elements.generic_status import GenericStatus
from weconnect.util import kelvinToCelsius

LOG = logging.getLogger("weconnect")

Expand Down Expand Up @@ -38,5 +39,6 @@ def update(self, fromDict, ignoreAttributes=None):
def __str__(self):
string = super().__str__()
if self.temperatureHvBatteryMin_K.enabled and self.temperatureHvBatteryMax_K.enabled:
string += f'\n\tBattery temperature between {self.temperatureHvBatteryMin_K.value} and {self.temperatureHvBatteryMax_K.value}°C'
string += f'\n\tBattery temperature between {kelvinToCelsius(self.temperatureHvBatteryMin_K.value)} and' \
+ f' {kelvinToCelsius(self.temperatureHvBatteryMax_K.value)}°C'
return string

0 comments on commit 12ef902

Please sign in to comment.