Skip to content

Commit

Permalink
fix set_api_level
Browse files Browse the repository at this point in the history
  • Loading branch information
Mips2648 committed Sep 9, 2024
1 parent d64fb66 commit f76f46e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions audiconnectpy/vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,27 @@ class Vehicle:
trips_supported: bool | None = None
position: Position | None = None
climatisation_timers: ClimatisationTimers = Field(default_factory=list)
_api_level = {
"climatisation": 2, # 2 or 3
"ventilation": 1, # 1 or other
"charger": 1, # 1 or 2 or 3 (json)
"windows_heating": 1, # 1 or 2 (json)
"lock": 2, # 1 or 2 (json)
}

@property
def api_level(self) -> dict[str, int]:
"""Return API Level."""
return {
"climatisation": 2, # 2 or 3
"ventilation": 1, # 1 or other
"charger": 1, # 1 or 2 or 3 (json)
"windows_heating": 1, # 1 or 2 (json)
"lock": 2, # 1 or 2 (json)
}
return self._api_level

def set_api_level(
self,
mode: Literal["climatisation", "ventilation", "charger", "window_heating"],
mode: Literal["climatisation", "ventilation", "charger", "windows_heating", "lock"],
value: int,
) -> None:
"""Set API Level."""
if mode in self.api_level.keys():
self.api_level[mode] = int(value)
if mode in self._api_level.keys():
self._api_level[mode] = int(value)

async def async_update(self) -> None:
"""Update data vehicle."""
Expand Down

0 comments on commit f76f46e

Please sign in to comment.