Skip to content

Commit

Permalink
cover sunRoof, roofCover and bonnet incorrect status
Browse files Browse the repository at this point in the history
  • Loading branch information
stickpin committed Jan 16, 2024
1 parent 3e19578 commit e893c84
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions volkswagencarnet/vw_vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,8 @@ def sunroof_closed(self) -> bool:
windows = find_path(self.attrs, "access.accessStatus.value.windows")
for window in windows:
if window["name"] == "sunRoof":
if not any(valid_status in window["status"] for valid_status in P.VALID_WINDOW_STATUS):
return None
return "closed" in window["status"]
return False

Expand Down Expand Up @@ -1511,6 +1513,8 @@ def roof_cover_closed(self) -> bool:
windows = find_path(self.attrs, "access.accessStatus.value.windows")
for window in windows:
if window["name"] == "roofCover":
if not any(valid_status in window["status"] for valid_status in P.VALID_WINDOW_STATUS):
return None
return "closed" in window["status"]
return False

Expand Down Expand Up @@ -1657,6 +1661,8 @@ def hood_closed(self) -> bool:
doors = find_path(self.attrs, f"{Services.ACCESS}.accessStatus.value.doors")
for door in doors:
if door["name"] == "bonnet":
if not any(valid_status in door["status"] for valid_status in P.VALID_DOOR_STATUS):
return None
return "closed" in door["status"]
return False

Expand Down

0 comments on commit e893c84

Please sign in to comment.