Code Monkey home page Code Monkey logo

aiobiketrax's People

Contributors

basilfx avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vlebourl

aiobiketrax's Issues

Hello!

Hi,

Sorry for openning an issue, it's the easiest way to get in contact. I discovered your library a few days ago after looking for a long time for a way to interact with my gps tracker. I used your library to create a custom device tracker for Home Assistant (here). Instead of importing your library though, I made a copy inside the component with some modification and some fixes.
Would you like me to deploy those fixes to your library?
Cheers for the good work anyways!

V.

login can be an empty string instead of None.

login = from_none(obj.get("login"))

Here is the obj passed to the Session constructor from dict

{
   "id":012345,
   "attributes":{
      "sendAnalytics":true,
      "fcmTokens":[
         "token1",
         "token2",
         "token3"
      ],
      "locale":"fr",
      "appEnvironment":"android-cordova-mobile-hybrid",
      "appPackage":"com.powunity.app",
      "appVersion":"android-3.7.0421",
      "webhookUrl":"full_webhook_url",
      "cbCustomerId":"xxxxxxxxx"
   },
   "name":"[email protected]",
   "login":"",
   "email":"[email protected]",
   "phone":"",
   "readonly":false,
   "administrator":false,
   "map":"",
   "latitude":0.0,
   "longitude":0.0,
   "zoom":0,
   "twelveHourFormat":false,
   "coordinateFormat":"",
   "disabled":false,
   "expirationTime":null,
   "deviceLimit":-1,
   "userLimit":0,
   "deviceReadonly":false,
   "token":"xxxxx",
   "limitCommands":false,
   "poiLayer":"",
   "password":null
}

Tag the source

Could you please tag the source again? This allows distributions to get the complete source from GitHub if they want.

Thanks

Handle expired licenses

Once a license expires, it can still show the data (trips, last position, etc.), but no updates will be received. Need to investigate what works and what does not.

Error retrieving subscriptions

When using the biketrax for homeassistant i get an error message. It seems to be related to the update of the subscription.
Using a small test python-script it seems to be related to the addonids

File "/home/local/src/local/biketrax/aiobiketrax/aiobiketrax/models.py", line 259, in from_dict
    addon_ids = from_union(
File "/home/local/src/local/biketrax/aiobiketrax/aiobiketrax/models.py", line 30, in from_union
    assert False

The data retrieved from the API is returned as json with a 200 as can be seen in the line below (idenfiers have been modified)
2023-10-27 19:20:57.814 DEBUG (MainThread) [aiobiketrax.api.responses] {'id': 11111, 'createdAt': '2023-04-24T12:51:34.000Z', 'updatedAt': '2023-10-25T15:33:00.000Z', 'subscriptionId': '11A1aaAaaAaAAAAAa', 'category': 'B2C', 'trialDuration': 365, 'setupFee': None, 'trialEnd': '2025-10-24T15:29:06.000Z', 'addonIds': 'AA0-A-0000', 'uniqueId': '1111111111'}
It looks like it doesn't expect addonIds to be a str.

AssertionError

something not right here

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh
self.data = await self._async_update_data()
File "/config/custom_components/biketrax/coordinator.py", line 111, in _async_update_data
await device.update_subscription()
File "/usr/local/lib/python3.10/site-packages/aiobiketrax/client.py", line 184, in update_subscription
] = await self._account.admin_api.get_subscription(self._device.unique_id)
File "/usr/local/lib/python3.10/site-packages/aiobiketrax/api.py", line 424, in get_subscription
return models.subscription_from_dict(response)
File "/usr/local/lib/python3.10/site-packages/aiobiketrax/models.py", line 802, in subscription_from_dict
return Subscription.from_dict(s)
File "/usr/local/lib/python3.10/site-packages/aiobiketrax/models.py", line 612, in from_dict
trial_duration = from_int(obj.get("trialDuration"))
File "/usr/local/lib/python3.10/site-packages/aiobiketrax/models.py", line 47, in from_int
assert isinstance(x, int) and not isinstance(x, bool)
AssertionError

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.