basilfx / aiobiketrax Goto Github PK
View Code? Open in Web Editor NEWPython library for interacting with the PowUnity BikeTrax GPS tracker.
License: MIT License
Python library for interacting with the PowUnity BikeTrax GPS tracker.
License: MIT License
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.
aiobiketrax/aiobiketrax/models.py
Line 521 in 1fe2cd5
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
}
Could you please tag the source again? This allows distributions to get the complete source from GitHub if they want.
Thanks
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.