From e7cb65c2cc723f2e01f5613e5b601dddbd930c45 Mon Sep 17 00:00:00 2001 From: Till Steinbach Date: Sun, 3 Mar 2024 16:36:57 +0100 Subject: [PATCH] abrp fix --- vwsfriend/vwsfriend/agents/abrp/abrp_agent.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vwsfriend/vwsfriend/agents/abrp/abrp_agent.py b/vwsfriend/vwsfriend/agents/abrp/abrp_agent.py index a941ec94..1e9bea1d 100644 --- a/vwsfriend/vwsfriend/agents/abrp/abrp_agent.py +++ b/vwsfriend/vwsfriend/agents/abrp/abrp_agent.py @@ -132,10 +132,10 @@ def commit(self): # noqa: C901 if self.weConnectVehicle.statusExists('measurements', 'temperatureBatteryStatus') \ and self.weConnectVehicle.domains['measurements']['temperatureBatteryStatus'].enabled: temperatureBatteryStatus = self.weConnectVehicle.domains['measurements']['temperatureBatteryStatus'] - if temperatureBatteryStatus.temperatureHvBatteryMin_K.enabled and odometerMeasurement.temperatureHvBatteryMin_K is not None \ - and temperatureBatteryStatus.temperatureHvBatteryMax_K.enabled and odometerMeasurement.temperatureHvBatteryMax_K is not None: - self.telemetryData['batt_temp'] = (kelvinToCelsius(odometerMeasurement.temperatureHvBatteryMin_K.value) - + kelvinToCelsius(odometerMeasurement.temperatureHvBatteryMax_K.value)) / 2 + if temperatureBatteryStatus.temperatureHvBatteryMin_K.enabled and temperatureBatteryStatus.temperatureHvBatteryMin_K is not None \ + and temperatureBatteryStatus.temperatureHvBatteryMax_K.enabled and temperatureBatteryStatus.temperatureHvBatteryMax_K is not None: + self.telemetryData['batt_temp'] = (kelvinToCelsius(temperatureBatteryStatus.temperatureHvBatteryMin_K.value) + + kelvinToCelsius(temperatureBatteryStatus.temperatureHvBatteryMax_K.value)) / 2 if self.weConnectVehicle.statusExists('charging', 'chargingStatus') \ and self.weConnectVehicle.domains['charging']['chargingStatus'].enabled: