Skip to content

Commit

Permalink
Fix decoding of heating stop reason
Browse files Browse the repository at this point in the history
  • Loading branch information
nanomad committed Apr 17, 2024
1 parent e6d552e commit 795905a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/saic_ismart_client_ng/api/vehicle_charging/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,11 @@ class ChrgPtcHeatResp:
def rvc_req_sts_decoded(self) -> Optional[bytes]:
return decode_bytes(input_value=self.rvcReqSts, field_name='rvcReqSts')

@property
def heating_stop_reason(self) -> HeatingStopReason | None:
if self.ptcHeatResp is not None:
return HeatingStopReason.to_code(self.ptcHeatResp)
return None

@dataclass
class ChargingControlRequest:
Expand Down Expand Up @@ -500,7 +505,7 @@ def charging_stop_reason(self) -> ChargingStopReason | None:

@property
def heating_stop_reason(self) -> HeatingStopReason | None:
if self.bmsPTCHeatSpRsn is not None:
if self.bmsPTCHeatResp is not None:
return HeatingStopReason.to_code(self.bmsPTCHeatResp)
return None

Expand Down

0 comments on commit 795905a

Please sign in to comment.