Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eb260b7a7e | |||
| e29e530d42 | |||
| 6db3afcd28 | |||
| 841740ec4c |
@@ -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 """
|
||||||
|
|||||||
4
setup.py
4
setup.py
@@ -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"],
|
||||||
|
|||||||
Reference in New Issue
Block a user