Skip to content

Commit

Permalink
fix: fix error for cars without heated steering wheels and seats
Browse files Browse the repository at this point in the history
  • Loading branch information
Megabytemb authored Apr 24, 2022
1 parent 26025b2 commit b5cf9bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion teslajsonpy/homeassistant/heated_seats.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def refresh(self) -> None:
if last_update >= self.__manual_update_time:
data = self._controller.get_climate_params(self._id)
self.__seat_heat_level = (
data[f"seat_heater_{self.__seat_name}"] if data else None
data.get(f"seat_heater_{self.__seat_name}") if data else None
)

async def set_seat_heat_level(self, level):
Expand Down
2 changes: 1 addition & 1 deletion teslajsonpy/homeassistant/heated_steering_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def refresh(self) -> None:
if last_update >= self.__manual_update_time:
data = self._controller.get_climate_params(self._id)
self.__steering_wheel_heated = (
data["steering_wheel_heater"] if data else None
data.get("steering_wheel_heater") if data else None
)

async def set_steering_wheel_heat(self, value: bool):
Expand Down

0 comments on commit b5cf9bb

Please sign in to comment.