Skip to content

Commit

Permalink
report AC charging and outside temperature to ABRP when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
tillsteinbach committed Sep 15, 2024
1 parent 6d8020b commit 2a7a50e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions vwsfriend/vwsfriend/agents/abrp/abrp_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ def commit(self): # noqa: C901
self.telemetryData['batt_temp'] = (kelvinToCelsius(temperatureBatteryStatus.temperatureHvBatteryMin_K.value)
+ kelvinToCelsius(temperatureBatteryStatus.temperatureHvBatteryMax_K.value)) / 2

if self.weConnectVehicle.statusExists('measurements', 'temperatureOutsideStatus') \
and self.weConnectVehicle.domains['measurements']['temperatureOutsideStatus'].enabled:
temperatureOutsideStatus = self.weConnectVehicle.domains['measurements']['temperatureOutsideStatus']
if temperatureOutsideStatus.temperatureOutside_K.enabled and temperatureOutsideStatus.temperatureOutside_K is not None:
self.telemetryData['ext_temp'] = kelvinToCelsius(temperatureOutsideStatus.temperatureOutside_K.value)

if self.weConnectVehicle.statusExists('charging', 'chargingStatus') \
and self.weConnectVehicle.domains['charging']['chargingStatus'].enabled:
chargingStatus = self.weConnectVehicle.domains['charging']['chargingStatus']
Expand All @@ -153,6 +159,8 @@ def commit(self): # noqa: C901

if chargingStatus.chargeType.enabled and chargingStatus.chargeType.value in [ChargingStatus.ChargeType.DC]:
self.telemetryData['is_dcfc'] = True
elif chargingStatus.chargeType.enabled and chargingStatus.chargeType.value in [ChargingStatus.ChargeType.AC]:
self.telemetryData['is_dcfc'] = False

self.updateTelemetry()
self.telemetryData.clear()

0 comments on commit 2a7a50e

Please sign in to comment.