Skip to content

Commit

Permalink
Merge pull request #243 from jschlyter/minor_fixes
Browse files Browse the repository at this point in the history
Minor fixes before release
  • Loading branch information
jschlyter authored Nov 18, 2024
2 parents fdf5a76 + aeae625 commit a6ace38
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ lint:
ruff check $(SOURCE)

reformat:
ruff check --select I --fix $(SOURCE)
ruff format $(SOURCE)
ruff check --select I --fix $(SOURCE) tests
ruff format $(SOURCE) tests

test:
PYTHONPATH=$(SOURCE) $(PYTEST) -vv tests
PYTHONPATH=. $(PYTEST) -vv tests
4 changes: 2 additions & 2 deletions custom_components/polestar_api/pypolestar/polestar.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ async def _query_graph_ql(
self.logger.debug("GraphQL TransportQueryError: %s", str(exc))
if (
exc.errors
and len(exc.errors)
and exc.errors[0]["extensions"]["code"] == "UNAUTHENTICATED"
and exc.errors[0].get("extensions", {}).get("code")
== "UNAUTHENTICATED"
):
self.latest_call_code = 401
raise PolestarNotAuthorizedException(
Expand Down
3 changes: 2 additions & 1 deletion tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from pathlib import Path

import pytest
from polestar_api.pypolestar.models import (

from custom_components.polestar_api.pypolestar.models import (
CarBatteryData,
CarInformationData,
CarOdometerData,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from datetime import date, datetime

import pytest
from polestar_api.pypolestar.utils import (

from custom_components.polestar_api.pypolestar.utils import (
get_field_name_date,
get_field_name_datetime,
get_field_name_float,
Expand Down

0 comments on commit a6ace38

Please sign in to comment.