Skip to content

Commit

Permalink
Merge pull request #235 from SvenC81/feature/adblue
Browse files Browse the repository at this point in the history
  • Loading branch information
cdnninja authored Mar 3, 2024
2 parents 9214fa4 + e0a24e5 commit cd67816
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 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
1 change: 1 addition & 0 deletions custom_components/audiconnect/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"range",
"service_inspection_time",
"service_inspection_distance",
"service_adblue_distance",
"oil_change_time",
"oil_change_distance",
"oil_level",
Expand Down
1 change: 1 addition & 0 deletions custom_components/audiconnect/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ def create_instruments():
Preheater(),
Sensor(attr="model", name="Model", icon="mdi:car-info", unit=None),
Sensor(attr="mileage", name="Mileage", icon="mdi:speedometer", unit="km"),
Sensor(attr="service_adblue_distance", name="AdBlue range", icon="mdi:gas-station", unit="km"),
Sensor(attr="range", name="Range", icon="mdi:gas-station", unit="km"),
Sensor(
attr="service_inspection_time",
Expand Down
2 changes: 2 additions & 0 deletions custom_components/audiconnect/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ def parse_float(val: str):
return float(val)
except ValueError:
return None
except TypeError:
return None

0 comments on commit cd67816

Please sign in to comment.