4 Commits

Author SHA1 Message Date
eb260b7a7e Shipping v0.8.2 2022-03-04 18:36:24 +01:00
e29e530d42 Fix tracher beacon reponse set to an array unsed of a unique object 2022-03-04 18:35:44 +01:00
6db3afcd28 Shipping v0.8.1 2022-03-04 16:07:48 +01:00
841740ec4c Fix miss import GeoRideTrackerBeacon 2022-03-04 16:07:02 +01:00
2 changed files with 11 additions and 8 deletions

View File

@@ -13,7 +13,8 @@ from georideapilib.objects import (
GeoRideUser, GeoRideUser,
GeoRideTrackerTrip, GeoRideTrackerTrip,
GeoRideTrackerPosition, GeoRideTrackerPosition,
GeoRideSharedTrip GeoRideSharedTrip,
GeoRideTrackerBeacon
) )
from georideapilib.exception import ( from georideapilib.exception import (
@@ -128,7 +129,7 @@ def get_trackers(token):
trackers.append(GeoRideTracker.from_json(json_tracker)) trackers.append(GeoRideTracker.from_json(json_tracker))
return trackers return trackers
def get_tracker_beacon(token, tracker_id): def get_tracker_beacons(token, tracker_id):
""" get user trackers """ """ get user trackers """
headers = {"Authorization": "Bearer " + token} headers = {"Authorization": "Bearer " + token}
@@ -137,11 +138,13 @@ def get_tracker_beacon(token, tracker_id):
headers=headers) headers=headers)
response_data = response.json() response_data = response.json()
trackers_beacons = []
if response.status_code == 200: if response.status_code == 200:
response_data['linked_tracker_id'] = tracker_id for json_tracker_beacon in response_data:
return GeoRideTrackerBeacon.from_json(response_data) _LOGGER.debug(json_tracker_beacon)
else: json_tracker_beacon['linked_tracker_id'] = tracker_id
return None trackers_beacons.append(GeoRideTrackerBeacon.from_json(json_tracker_beacon))
return trackers_beacons
def get_trips(token, tracker_id, from_date, to_date): def get_trips(token, tracker_id, from_date, to_date):
""" return all trips between two dates """ """ return all trips between two dates """

View File

@@ -19,13 +19,13 @@ CURRENT_DIR = os.path.dirname(__file__)
setup( setup(
name='georideapilib', name='georideapilib',
packages=['georideapilib'], # this must be the same as the name above packages=['georideapilib'], # this must be the same as the name above
version='0.8.0', version='0.8.2',
description='Lib to control GeoRide tracker devices with theire rest api', description='Lib to control GeoRide tracker devices with theire rest api',
author='Matthieu DUVAL', author='Matthieu DUVAL',
author_email='georideapilib@duval-dev.fr', author_email='georideapilib@duval-dev.fr',
# use the URL to the github repo # use the URL to the github repo
url='https://github.com/hacf/georide-api', url='https://github.com/hacf/georide-api',
download_url='https://codeload.github.com/hacf/georide-api/tar.gz/0.8.0', download_url='https://codeload.github.com/hacf/georide-api/tar.gz/0.8.1',
keywords=['rest', 'georide', 'api', 'grutier', 'GeoRide'], # arbitrary keywords keywords=['rest', 'georide', 'api', 'grutier', 'GeoRide'], # arbitrary keywords
classifiers=[], classifiers=[],
install_requires=["python-socketio[client]==4.6.1"], install_requires=["python-socketio[client]==4.6.1"],