Skip to content

Commit

Permalink
Update audi_connect_account.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DivingUp authored Mar 3, 2024
1 parent 9214fa4 commit 992e2a7
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion custom_components/audiconnect/audi_connect_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ def service_inspection_distance_supported(self):
def service_adblue_distance(self):
"""Return distance left for service inspection"""
if self.service_adblue_distance_supported:
return -int(
return int(
self._vehicle.fields.get("ADBLUE_RANGE")
)

Expand Down Expand Up @@ -1276,6 +1276,18 @@ def primary_engine_range_supported(self):
check = self._vehicle.state.get("primaryEngineRange")
if check and check != "unsupported":
return True

@property
def primary_engine_range_percent(self):
"""Return primary engine range"""
if self.primary_engine_range_percent_supported:
return self._vehicle.state.get("primaryEngineRangePercent")

@property
def primary_engine_range_percent_supported(self):
check = self._vehicle.state.get("primaryEngineRangePercent")
if check and check != "unsupported":
return True

@property
def secondary_engine_range(self):
Expand All @@ -1288,6 +1300,32 @@ def secondary_engine_range_supported(self):
check = self._vehicle.state.get("secondaryEngineRange")
if check and check != "unsupported":
return True

@property
def car_type(self):
"""Return secondary engine range"""
if self.car_type_supported:
return self._vehicle.state.get("carType")

@property
def car_type_supported(self):
check = self._vehicle.state.get("carType")
if check and check != "unsupported":
return True

@property
def secondary_engine_range_percent(self):
"""Return secondary engine range"""
if self.secondary_engine_range_percent_supported:
return self._vehicle.state.get("secondaryEngineRangePercent")

@property
def secondary_engine_range_percent_supported(self):
check = self._vehicle.state.get("secondaryEngineRangePercent")
if check and check != "unsupported":
return True



@property
def hybrid_range(self):
Expand Down

0 comments on commit 992e2a7

Please sign in to comment.