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

can't Login to Biketrax #150

Open
hellodosi opened this issue Jan 9, 2025 · 3 comments
Open

can't Login to Biketrax #150

hellodosi opened this issue Jan 9, 2025 · 3 comments

Comments

@hellodosi
Copy link

Unfortunately can't log into the integration. Login on the webapp of Powunity works fine.

Unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aiobiketrax/api.py", line 49, in wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiobiketrax/api.py", line 220, in get_devices
    return [models.device_from_dict(device) for device in response]
            ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiobiketrax/models.py", line 874, in device_from_dict
    return Device.from_dict(s)
           ~~~~~~~~~~~~~~~~^^^
  File "/usr/local/lib/python3.13/site-packages/aiobiketrax/models.py", line 631, in from_dict
    attributes = DeviceAttributes.from_dict(obj.get("attributes"))
  File "/usr/local/lib/python3.13/site-packages/aiobiketrax/models.py", line 555, in from_dict
    passport = from_union([Passport.from_dict, from_none], obj.get("passport"))
  File "/usr/local/lib/python3.13/site-packages/aiobiketrax/models.py", line 30, in from_union
    assert False
           ^^^^^
AssertionError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/biketrax/config_flow.py", line 78, in async_step_user
    info = await validate_input(self.hass, user_input)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/biketrax/config_flow.py", line 42, in validate_input
    await account.update_devices()
  File "/usr/local/lib/python3.13/site-packages/aiobiketrax/client.py", line 61, in update_devices
    device.id: device for device in await self.traccar_api.get_devices()
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiobiketrax/api.py", line 51, in wrapper
    raise ApiError("Unable to parse API response.") from e
aiobiketrax.exceptions.ApiError: Unable to parse API response.
@basilfx
Copy link
Owner

basilfx commented Jan 9, 2025

Please check #149 (comment), and see if that works for you.

@hellodosi
Copy link
Author

unfortunately this didn't work for me.

How to get the raw response for debugging?

@basilfx
Copy link
Owner

basilfx commented Jan 23, 2025

You can enable additional loggers using this.

The loggers of interest are:

  • aiobiketrax.api - API logging.
  • aiobiketrax.api.responses - Additional API response logging.
  • aiobiketrax.api.client - Client interaction logging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants