From 12ef902e67423350c3827c3216518d28dd6f3c20 Mon Sep 17 00:00:00 2001 From: Till Steinbach Date: Fri, 27 Oct 2023 09:24:54 +0200 Subject: [PATCH] fix K to C conversion --- weconnect/elements/temperature_battery_status.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/weconnect/elements/temperature_battery_status.py b/weconnect/elements/temperature_battery_status.py index 55f85d6..9baa0bc 100644 --- a/weconnect/elements/temperature_battery_status.py +++ b/weconnect/elements/temperature_battery_status.py @@ -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") @@ -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