Skip to content

Commit

Permalink
clean up logging for found VINs
Browse files Browse the repository at this point in the history
  • Loading branch information
jschlyter committed Dec 15, 2024
1 parent 10cc652 commit 72fbbb0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions custom_components/polestar_api/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,10 @@ async def _test_credentials(
)
await api_client.async_init()

found_vins = api_client.vins
_LOGGER.debug("Found %d cars for %s", len(found_vins), username)

if not found_vins:
_LOGGER.warning("No cars found for %s", username)
if found_vins := api_client.vins:
_LOGGER.debug("Found %d VINs for %s", len(found_vins), username)
else:
_LOGGER.warning("No VINs found for %s", username)
raise NoCarsFoundException

if vin and vin not in found_vins:
Expand Down

0 comments on commit 72fbbb0

Please sign in to comment.