Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/status_publisher/charge/chrg_mgmt_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

from saic_ismart_client_ng.api.vehicle_charging import (
ChargeCurrentLimitCode,
ChargingStopReason,
ChrgMgmtData,
HeatingStopReason,
ScheduledChargingMode,
TargetBatteryCode,
)
Expand Down Expand Up @@ -110,6 +112,7 @@ def publish(self, charge_mgmt_data: ChrgMgmtData) -> ChrgMgmtDataProcessingResul
self._transform_and_publish(
topic=mqtt_topics.DRIVETRAIN_CHARGING_STOP_REASON,
value=charge_mgmt_data.charging_stop_reason,
validator=lambda x: x != ChargingStopReason.NO_REASON,
transform=lambda x: f"UNKNOWN {charge_mgmt_data.bmsChrgSpRsn}"
if x is None
else x.name,
Expand Down Expand Up @@ -149,6 +152,7 @@ def publish(self, charge_mgmt_data: ChrgMgmtData) -> ChrgMgmtDataProcessingResul
self._transform_and_publish(
topic=mqtt_topics.DRIVETRAIN_BATTERY_HEATING_STOP_REASON,
value=charge_mgmt_data.heating_stop_reason,
validator=lambda x: x != HeatingStopReason.NO_REASON,
transform=lambda x: f"UNKNOWN ({charge_mgmt_data.bmsPTCHeatResp})"
if x is None
else x.name,
Expand Down