Skip to content

Commit

Permalink
fix: Canada fix for cars that have never been serviced (#163)
Browse files Browse the repository at this point in the history
* fix: Canada fix for cars that have never been serviced

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: cdnninja <[email protected]>
  • Loading branch information
3 people authored Nov 19, 2021
1 parent 0fd4583 commit e508ec2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions custom_components/kia_uvo/KiaUvoApiCA.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@ def get_cached_vehicle_status(self, token: Token):
vehicle_status["nextService"]["unit"] = response["imatServiceOdometerUnit"]
vehicle_status["nextService"]["value"] = response["imatServiceOdometer"]

vehicle_status["lastService"] = {}
vehicle_status["lastService"]["unit"] = response["msopServiceOdometerUnit"]
vehicle_status["lastService"]["value"] = response["msopServiceOdometer"]
# Handles cars that have never had service
if response.get("msopServiceOdometer"):
vehicle_status["lastService"] = {}
vehicle_status["lastService"]["unit"] = response["msopServiceOdometerUnit"]
vehicle_status["lastService"]["value"] = response["msopServiceOdometer"]

if not self.old_vehicle_status == {}:
if (
Expand Down

0 comments on commit e508ec2

Please sign in to comment.