diff --git a/src/saic_ismart_client/ota_v3_0/data_model.py b/src/saic_ismart_client/ota_v3_0/data_model.py index 6d06227..56ad6b6 100644 --- a/src/saic_ismart_client/ota_v3_0/data_model.py +++ b/src/saic_ismart_client/ota_v3_0/data_model.py @@ -154,6 +154,9 @@ def get_current(self) -> float: def get_voltage(self) -> float: return self.bmsPackVol * 0.25 + def is_battery_heating(self) -> bool: + return self.bmsPTCHeatReqDspCmd == 1 + def get_power(self) -> float: return self.get_current() * self.get_voltage() / 1000.0 diff --git a/src/saic_ismart_client/saic_api.py b/src/saic_ismart_client/saic_api.py index 510945d..9fedee2 100644 --- a/src/saic_ismart_client/saic_api.py +++ b/src/saic_ismart_client/saic_api.py @@ -567,7 +567,7 @@ def get_charging_status_with_retry(self, vin_info: VinInfo) -> MessageV30: def control_battery_heating(self, enable: bool, vin_info: VinInfo, event_id: str = None) -> MessageV30: chrg_heat_req = OtaChrgHeatReq() - chrg_heat_req.ptcHeatReq = bool_to_int(enable) + chrg_heat_req.ptcHeatReq = 1 if enable else 2 chrg_heat_req_msg = MessageV30(MessageBodyV30(), chrg_heat_req) application_id = '516' application_data_protocol_version = 768