7 Commits

Author SHA1 Message Date
a7d7c2864c Shipping v1.0.0 2023-05-24 12:34:47 +02:00
b32c84e3db Migrate to new hosts for GeoRide 2023-05-24 12:34:18 +02:00
8b3cf944dd Shipping v0.9.6 2023-03-24 23:13:01 +01:00
c1497f0b00 Fix None unsted of null 2023-03-24 23:12:41 +01:00
ef926fd983 Shipping v0.9.5 2023-03-24 23:08:04 +01:00
61af626207 Change version to 0.9.5 2023-03-24 23:07:32 +01:00
72fb58fa12 Add a more tracker fields as optional 2023-03-24 23:03:35 +01:00
4 changed files with 17 additions and 16 deletions

View File

@@ -22,7 +22,8 @@ from georideapilib.exception import (
UnauthorizedException UnauthorizedException
) )
GEORIDE_API_HOST = "https://api.georide.fr" GEORIDE_API_HOST = "https://api.georide.com"
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

@@ -495,26 +495,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'),
json['role'], # Mandatory cls.json_field_protect(json,'role', "owner"),
json['lastPaymentDate'],# Mandatory cls.json_field_protect(json,'lastPaymentDate', None),
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'),
json['odometer'],#Mandatory cls.json_field_protect(json,'odometer', False),
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'),
json['speed'], # Mandatory cls.json_field_protect(json,'speed', 0), # Mandatory
json['moving'], # Mandatory cls.json_field_protect(json,'moving', False),
cls.json_field_protect(json,'positionId', -1), cls.json_field_protect(json,'positionId', -1),
json['latitude'], # Mandatory cls.json_field_protect(json,'latitude', 47.0),
json['longitude'], # Mandatory cls.json_field_protect(json,'longitude', -1.0),
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'),
json['isLocked'], # Mandatory cls.json_field_protect(json,'isLocked', False),
json['canSeePosition'],# Mandatory cls.json_field_protect(json,'canSeePosition', False),
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 +523,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),
json['status'],# Mandatory cls.json_field_protect(json,'status', 'unknown'),
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),

View File

@@ -2,7 +2,7 @@
import logging import logging
import socketio import socketio
from georideapilib.api import GEORIDE_API_HOST from georideapilib.api import GEORIDE_SOCKET_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_API_HOST, headers={'token': auth_token}) sio.connect(GEORIDE_SOCKET_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,16 +19,16 @@ 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='0.9.4', version='1.0.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/0.9.3', download_url='https://codeload.github.com/hacf/georide-api/tar.gz/1.0.0',
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]==5.8.0"],
tests_require=[ tests_require=[
'pytest>=3.7', 'pytest>=3.7',
'pytest-pep8', 'pytest-pep8',