diff --git a/custom_components/audiconnect/audi_connect_account.py b/custom_components/audiconnect/audi_connect_account.py index 869b68e0..50e66f7a 100644 --- a/custom_components/audiconnect/audi_connect_account.py +++ b/custom_components/audiconnect/audi_connect_account.py @@ -1640,7 +1640,7 @@ def state_of_charge_supported(self): def remaining_charging_time(self): """Return remaining charging time""" if self.remaining_charging_time_supported: - return self._vehicle.state.get("remainingChargingTime") + return self._vehicle.state.get("remainingChargingTime", 0) @property def remaining_charging_time_unit(self): @@ -1648,9 +1648,7 @@ def remaining_charging_time_unit(self): @property def remaining_charging_time_supported(self): - check = self._vehicle.state.get("remainingChargingTime") - if check is not None: - return True + return self.car_type in ["hybrid", "electric"] @property def charging_complete_time(self): diff --git a/custom_components/audiconnect/audi_models.py b/custom_components/audiconnect/audi_models.py index ecddbd9b..2cb53d21 100644 --- a/custom_components/audiconnect/audi_models.py +++ b/custom_components/audiconnect/audi_models.py @@ -268,13 +268,6 @@ def _tryAppendStateWithTs(self, json, name, tsoff, loc): val = self._getFromJson(json, loc) # _LOGGER.debug("Initial value retrieved for '%s': %s", name, val) - # Special handling for remainingChargingTime - if name == "remainingChargingTime" and val is None: - val = 0 - _LOGGER.debug( - "TRY APPEND STATE: 'remainingChargingTime' adjusted to 0 due to None value" - ) - if val is not None: loc[tsoff:] = ["carCapturedTimestamp"] # _LOGGER.debug("Updated loc for timestamp retrieval: %s", loc)