Rework of GeoRide objects and add missing fields on Traker

This commit is contained in:
Matthieu DUVAL
2023-02-27 18:06:19 +01:00
parent edf209272d
commit 7e399cf982
14 changed files with 1309 additions and 1164 deletions

View File

@@ -0,0 +1,33 @@
"""
Georide objects implementation
@author Matthieu DUVAL <matthieu@duval-dev.fr>
"""
import time
import logging
_LOGGER = logging.getLogger(__name__)
class GeoRideSharedTrip:
""" Shared trip object representation """
def __init__(self, url, shareId):
self._url = url
self._share_id = shareId
@property
def url(self):
""" shared trip url """
return self._url
@property
def share_id(self):
""" shared trip id """
return self._share_id
@staticmethod
def from_json(json):
"""return new object fromjson"""
return GeoRideSharedTrip(
json['url'],
json['shareId']
)