16 Commits

Author SHA1 Message Date
39b2c3c776 Shipping v0.9.0 2023-02-27 18:54:17 +01:00
733ef83127 Shipping v0.8.4 2022-03-20 14:02:00 +01:00
b53fdc07f8 Shipping v0.8.3 2022-03-19 21:43:23 +01:00
eb260b7a7e Shipping v0.8.2 2022-03-04 18:36:24 +01:00
6db3afcd28 Shipping v0.8.1 2022-03-04 16:07:48 +01:00
00c66320b5 Shipping v0.8.0 2022-03-04 15:44:43 +01:00
5823012259 Shipping v0.7.1 2022-03-04 10:30:13 +01:00
7dec38109a Shipping v0.7.0 2022-03-03 20:13:36 +01:00
b6ede1af3b Shipping 0.6.1 2021-05-05 22:43:49 +02:00
e38a402d44 Shipping v0.6.0 2021-04-11 17:41:10 +02:00
e59cd77908 Shipping v0.4.4 2019-11-03 20:26:49 +01:00
6ab8749f11 Shipping v0.4.3 2019-11-02 17:51:48 +01:00
13df6822c8 Shipping v0.4.2 2019-11-02 17:42:36 +01:00
b78c503b31 Shipping v0.4.1 2019-10-30 20:35:02 +01:00
e69b2dfab9 Shipping v0.4.0 2019-10-29 22:46:15 +01:00
f168ad9e47 Shipping v0.3.0 2019-10-29 21:58:12 +01:00
5 changed files with 26 additions and 25 deletions

View File

@@ -22,8 +22,7 @@ from georideapilib.exception import (
UnauthorizedException UnauthorizedException
) )
GEORIDE_API_HOST = "https://api.georide.com" GEORIDE_API_HOST = "https://api.georide.fr"
GEORIDE_SOCKET_HOST = "https://socket.georide.com"
GEORIDE_API_ENDPOINT_LOGIN = "/user/login" GEORIDE_API_ENDPOINT_LOGIN = "/user/login"
GEORIDE_API_ENDPOINT_NEW_TOKEN = "/user/new-token" GEORIDE_API_ENDPOINT_NEW_TOKEN = "/user/new-token"
GEORIDE_API_ENDPOINT_LOGOUT = "/user/logout" GEORIDE_API_ENDPOINT_LOGOUT = "/user/logout"

View File

@@ -11,7 +11,7 @@ class GeoRideAccount:
""" Account object representation """ """ Account object representation """
def __init__(self, account_id, email, is_admin, auth_token): def __init__(self, account_id, email, is_admin, auth_token):
self._account_id = account_id self._account_id = account_id
self._email = email self._email = emailgit
self._is_admin = is_admin self._is_admin = is_admin
self._auth_token = auth_token self._auth_token = auth_token

View File

@@ -462,7 +462,7 @@ class GeoRideTracker(metaclass=JsonMgtMetaClass): # pylint: disable=R0904,R0902
return self._ecall_crash_mode return self._ecall_crash_mode
@property @property
def assistance_theft_activated(self): def _ssistance_theft_activated(self):
""" assistanceTheftActivated property """ """ assistanceTheftActivated property """
return self._assistance_theft_activated return self._assistance_theft_activated
@@ -485,6 +485,13 @@ class GeoRideTracker(metaclass=JsonMgtMetaClass): # pylint: disable=R0904,R0902
@classmethod @classmethod
def from_json(cls, json): def from_json(cls, json):
"""return new object fromjson""" """return new object fromjson"""
"version": 3,
"eCallCrashMode": "default",
"assistanceTheftActivated": True,
"model": "georide-3",
"businessModel": "leasing",
"hasTheftCaseOpened": False,
return GeoRideTracker( return GeoRideTracker(
json['trackerId'], # Mandatory json['trackerId'], # Mandatory
@@ -495,26 +502,26 @@ class GeoRideTracker(metaclass=JsonMgtMetaClass): # pylint: disable=R0904,R0902
cls.json_field_protect(json,'isOldTracker', False), cls.json_field_protect(json,'isOldTracker', False),
cls.json_field_protect(json,'autoLockFreezedTo'), cls.json_field_protect(json,'autoLockFreezedTo'),
cls.json_field_protect(json,'fixtime'), cls.json_field_protect(json,'fixtime'),
cls.json_field_protect(json,'role', "owner"), json['role'], # Mandatory
cls.json_field_protect(json,'lastPaymentDate', None), json['lastPaymentDate'],# Mandatory
cls.json_field_protect(json,'giftCardId'), cls.json_field_protect(json,'giftCardId'),
cls.json_field_protect(json,'expires'), cls.json_field_protect(json,'expires'),
cls.json_field_protect(json,'activationDate'), cls.json_field_protect(json,'activationDate'),
cls.json_field_protect(json,'odometer', False), json['odometer'],#Mandatory
cls.json_field_protect(json,'isStolen', False), cls.json_field_protect(json,'isStolen', False),
cls.json_field_protect(json,'isCrashed', False), cls.json_field_protect(json,'isCrashed', False),
cls.json_field_protect(json,'crashDetectionDisabled'), cls.json_field_protect(json,'crashDetectionDisabled'),
cls.json_field_protect(json,'speed', 0), # Mandatory json['speed'], # Mandatory
cls.json_field_protect(json,'moving', False), json['moving'], # Mandatory
cls.json_field_protect(json,'positionId', -1), cls.json_field_protect(json,'positionId', -1),
cls.json_field_protect(json,'latitude', 47.0), json['latitude'], # Mandatory
cls.json_field_protect(json,'longitude', -1.0), json['longitude'], # Mandatory
cls.json_field_protect(json,'altitude', 0), cls.json_field_protect(json,'altitude', 0),
cls.json_field_protect(json,'lockedPositionId'), cls.json_field_protect(json,'lockedPositionId'),
cls.json_field_protect(json,'lockedLatitude'), cls.json_field_protect(json,'lockedLatitude'),
cls.json_field_protect(json,'lockedLongitude'), cls.json_field_protect(json,'lockedLongitude'),
cls.json_field_protect(json,'isLocked', False), json['isLocked'], # Mandatory
cls.json_field_protect(json,'canSeePosition', False), json['canSeePosition'],# Mandatory
cls.json_field_protect(json,'canLock', False), cls.json_field_protect(json,'canLock', False),
cls.json_field_protect(json,'canUnlock', False), cls.json_field_protect(json,'canUnlock', False),
cls.json_field_protect(json,'canShare', False), cls.json_field_protect(json,'canShare', False),
@@ -523,7 +530,7 @@ class GeoRideTracker(metaclass=JsonMgtMetaClass): # pylint: disable=R0904,R0902
cls.json_field_protect(json,'canSeeStatistics', False), cls.json_field_protect(json,'canSeeStatistics', False),
cls.json_field_protect(json,'canSendBrokenDownSignal', False), cls.json_field_protect(json,'canSendBrokenDownSignal', False),
cls.json_field_protect(json,'canSendStolenSignal', False), cls.json_field_protect(json,'canSendStolenSignal', False),
cls.json_field_protect(json,'status', 'unknown'), json['status'],# Mandatory
cls.json_field_protect(json,'subscriptionId', -1), cls.json_field_protect(json,'subscriptionId', -1),
cls.json_field_protect(json,'externalBatteryVoltage', -1.0), cls.json_field_protect(json,'externalBatteryVoltage', -1.0),
cls.json_field_protect(json,'internalBatteryVoltage', -1.0), cls.json_field_protect(json,'internalBatteryVoltage', -1.0),
@@ -543,12 +550,7 @@ class GeoRideTracker(metaclass=JsonMgtMetaClass): # pylint: disable=R0904,R0902
cls.json_field_protect(json,'softwareVersion', 1), cls.json_field_protect(json,'softwareVersion', 1),
cls.json_field_protect(json,'hasBeacon', False), cls.json_field_protect(json,'hasBeacon', False),
cls.json_field_protect(json,'hasOutdatedBeacons', False), cls.json_field_protect(json,'hasOutdatedBeacons', False),
cls.json_field_protect(json,'eCallActivated', False), cls.json_field_protect(json,'eCallActivated', False)
cls.json_field_protect(json,'eCallCrashMode'),
cls.json_field_protect(json,'assistanceTheftActivated'),
cls.json_field_protect(json,'model'),
cls.json_field_protect(json,'businessModel'),
cls.json_field_protect(json,'hasTheftCaseOpened'),
) )
def update_all_data(self, tracker): def update_all_data(self, tracker):

View File

@@ -2,7 +2,7 @@
import logging import logging
import socketio import socketio
from georideapilib.api import GEORIDE_SOCKET_HOST from georideapilib.api import GEORIDE_API_HOST
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@@ -104,7 +104,7 @@ class GeoRideSocket():
def connect(self, auth_token): def connect(self, auth_token):
""" connect to the georide socket""" """ connect to the georide socket"""
if self._initialised is not False: if self._initialised is not False:
sio.connect(GEORIDE_SOCKET_HOST, headers={'token': auth_token}) sio.connect(GEORIDE_API_HOST, headers={'token': auth_token})
sio.wait() sio.wait()
else: else:
_LOGGER.error("Please call init() before") _LOGGER.error("Please call init() before")

View File

@@ -19,19 +19,19 @@ CURRENT_DIR = os.path.dirname(__file__)
setup( setup(
name='georideapilib', name='georideapilib',
packages=['georideapilib', 'georideapilib.objects'], # this must be the same as the name above packages=['georideapilib', 'georideapilib.objects'], # this must be the same as the name above
version='1.0.0', version='0.9.0',
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/1.0.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"],
tests_require=[ tests_require=[
'pytest>=3.7', 'pytest>=3.7',
'pytest-pep8', 'pytest-pep8',
'pytest-cov', 'pytest-cov',
'python-coveralls', 'python-coveralls',
'pylint', 'pylint',