Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "setup Connected Services Error" due to latest API Changes #240

Merged
merged 10 commits into from
Nov 12, 2023
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
fail-fast: false

steps:
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.2.2
poetry-version: 1.5.1

- name: Install dependencies
run: poetry install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Pre-commit
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ubuntu-latest
env:
OS: ubuntu-latest
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.2.2
poetry-version: 1.5.1

- name: Install dependencies
run: poetry install
Expand Down
12 changes: 10 additions & 2 deletions mytoyota/models/vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,17 @@ def is_connected_services_enabled(self) -> bool:
if self.vin and self._connected_services:
if (
"connectedService" in self._connected_services
and "status" in self._connected_services["connectedService"]
and "devices" in self._connected_services["connectedService"]
):
if self._connected_services["connectedService"]["status"] == "ACTIVE":
vin_specific_connected_service = None
for device in self._connected_services["connectedService"]["devices"]:
if device.get("vin") == self.vin:
vin_specific_connected_service = device
break
if (
vin_specific_connected_service
and vin_specific_connected_service.get("state") == "ACTIVE"
):
return True

_LOGGER.error(
Expand Down
Loading
Loading