Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ffe1e41dbd | |||
| b32c84e3db | |||
| c1497f0b00 | |||
| 61af626207 | |||
| 72fb58fa12 | |||
|
|
5c977e3732 | ||
| cb5b85e9d4 | |||
| 40c0c9aa69 | |||
| 5b1bf8c1c4 |
@@ -22,7 +22,8 @@ from georideapilib.exception import (
|
||||
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_NEW_TOKEN = "/user/new-token"
|
||||
GEORIDE_API_ENDPOINT_LOGOUT = "/user/logout"
|
||||
|
||||
@@ -11,7 +11,7 @@ class GeoRideAccount:
|
||||
""" Account object representation """
|
||||
def __init__(self, account_id, email, is_admin, auth_token):
|
||||
self._account_id = account_id
|
||||
self._email = emailgit
|
||||
self._email = email
|
||||
self._is_admin = is_admin
|
||||
self._auth_token = auth_token
|
||||
|
||||
|
||||
@@ -462,7 +462,7 @@ class GeoRideTracker(metaclass=JsonMgtMetaClass): # pylint: disable=R0904,R0902
|
||||
return self._ecall_crash_mode
|
||||
|
||||
@property
|
||||
def _ssistance_theft_activated(self):
|
||||
def assistance_theft_activated(self):
|
||||
""" assistanceTheftActivated property """
|
||||
return self._assistance_theft_activated
|
||||
|
||||
@@ -486,13 +486,6 @@ class GeoRideTracker(metaclass=JsonMgtMetaClass): # pylint: disable=R0904,R0902
|
||||
def from_json(cls, json):
|
||||
"""return new object fromjson"""
|
||||
|
||||
"version": 3,
|
||||
"eCallCrashMode": "default",
|
||||
"assistanceTheftActivated": True,
|
||||
"model": "georide-3",
|
||||
"businessModel": "leasing",
|
||||
"hasTheftCaseOpened": False,
|
||||
|
||||
return GeoRideTracker(
|
||||
json['trackerId'], # Mandatory
|
||||
json['trackerName'], # Mandatory
|
||||
@@ -502,26 +495,26 @@ class GeoRideTracker(metaclass=JsonMgtMetaClass): # pylint: disable=R0904,R0902
|
||||
cls.json_field_protect(json,'isOldTracker', False),
|
||||
cls.json_field_protect(json,'autoLockFreezedTo'),
|
||||
cls.json_field_protect(json,'fixtime'),
|
||||
json['role'], # Mandatory
|
||||
json['lastPaymentDate'],# Mandatory
|
||||
cls.json_field_protect(json,'role', "owner"),
|
||||
cls.json_field_protect(json,'lastPaymentDate', None),
|
||||
cls.json_field_protect(json,'giftCardId'),
|
||||
cls.json_field_protect(json,'expires'),
|
||||
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,'isCrashed', False),
|
||||
cls.json_field_protect(json,'crashDetectionDisabled'),
|
||||
json['speed'], # Mandatory
|
||||
json['moving'], # Mandatory
|
||||
cls.json_field_protect(json,'speed', 0), # Mandatory
|
||||
cls.json_field_protect(json,'moving', False),
|
||||
cls.json_field_protect(json,'positionId', -1),
|
||||
json['latitude'], # Mandatory
|
||||
json['longitude'], # Mandatory
|
||||
cls.json_field_protect(json,'latitude', 47.0),
|
||||
cls.json_field_protect(json,'longitude', -1.0),
|
||||
cls.json_field_protect(json,'altitude', 0),
|
||||
cls.json_field_protect(json,'lockedPositionId'),
|
||||
cls.json_field_protect(json,'lockedLatitude'),
|
||||
cls.json_field_protect(json,'lockedLongitude'),
|
||||
json['isLocked'], # Mandatory
|
||||
json['canSeePosition'],# Mandatory
|
||||
cls.json_field_protect(json,'isLocked', False),
|
||||
cls.json_field_protect(json,'canSeePosition', False),
|
||||
cls.json_field_protect(json,'canLock', False),
|
||||
cls.json_field_protect(json,'canUnlock', False),
|
||||
cls.json_field_protect(json,'canShare', False),
|
||||
@@ -530,7 +523,7 @@ class GeoRideTracker(metaclass=JsonMgtMetaClass): # pylint: disable=R0904,R0902
|
||||
cls.json_field_protect(json,'canSeeStatistics', False),
|
||||
cls.json_field_protect(json,'canSendBrokenDownSignal', 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,'externalBatteryVoltage', -1.0),
|
||||
cls.json_field_protect(json,'internalBatteryVoltage', -1.0),
|
||||
@@ -550,7 +543,12 @@ class GeoRideTracker(metaclass=JsonMgtMetaClass): # pylint: disable=R0904,R0902
|
||||
cls.json_field_protect(json,'softwareVersion', 1),
|
||||
cls.json_field_protect(json,'hasBeacon', 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):
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import logging
|
||||
import socketio
|
||||
|
||||
from georideapilib.api import GEORIDE_API_HOST
|
||||
from georideapilib.api import GEORIDE_SOCKET_HOST
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -104,7 +104,7 @@ class GeoRideSocket():
|
||||
def connect(self, auth_token):
|
||||
""" connect to the georide socket"""
|
||||
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()
|
||||
else:
|
||||
_LOGGER.error("Please call init() before")
|
||||
|
||||
4
setup.py
4
setup.py
@@ -19,13 +19,13 @@ CURRENT_DIR = os.path.dirname(__file__)
|
||||
setup(
|
||||
name='georideapilib',
|
||||
packages=['georideapilib', 'georideapilib.objects'], # this must be the same as the name above
|
||||
version='0.9.0',
|
||||
version='1.0.0',
|
||||
description='Lib to control GeoRide tracker devices with theire rest api',
|
||||
author='Matthieu DUVAL',
|
||||
author_email='georideapilib@duval-dev.fr',
|
||||
# use the URL to the github repo
|
||||
url='https://github.com/hacf/georide-api',
|
||||
download_url='https://codeload.github.com/hacf/georide-api/tar.gz/0.8.1',
|
||||
download_url='https://codeload.github.com/hacf/georide-api/tar.gz/1.0.0',
|
||||
keywords=['rest', 'georide', 'api', 'grutier', 'GeoRide'], # arbitrary keywords
|
||||
classifiers=[],
|
||||
install_requires=["python-socketio[client]==4.6.1"],
|
||||
|
||||
Reference in New Issue
Block a user