Skip to content

Commit

Permalink
Add missing props to ChargingControlResp
Browse files Browse the repository at this point in the history
  • Loading branch information
nanomad committed Feb 3, 2024
1 parent 1bb10f3 commit 15c9db4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/saic_ismart_client_ng/api/vehicle_charging/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,22 @@ class ChargingControlResp:
def rvc_req_sts_decoded(self) -> Optional[bytes]:
return decode_bytes(input_value=self.rvcReqSts, field_name='rvcReqSts')

@property
def charge_target_soc(self) -> Optional[TargetBatteryCode]:
raw_target_soc = self.bmsOnBdChrgTrgtSOCDspCmd
try:
return TargetBatteryCode(raw_target_soc)
except ValueError:
return None

@property
def is_battery_heating(self) -> bool:
return self.bmsPTCHeatReqDspCmd == 1

@property
def charging_port_locked(self) -> bool:
return self.ccuEleccLckCtrlDspCmd == 1


@dataclass
class ScheduledBatteryHeatingRequest:
Expand Down

0 comments on commit 15c9db4

Please sign in to comment.