17 Commits

Author SHA1 Message Date
733ef83127 Shipping v0.8.4 2022-03-20 14:02:00 +01:00
edf209272d Fix missign field 'cardInformation' on some client 2022-03-20 14:01:22 +01:00
b53fdc07f8 Shipping v0.8.3 2022-03-19 21:43:23 +01:00
9c7d2890da Add support of missing fileds on GeoRide Subscription, remove deprectaed class 2022-03-19 21:39:49 +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
3 changed files with 16 additions and 31 deletions

View File

@@ -882,7 +882,7 @@ class GeoRideTrackerBeacon:
self._power = tracker_beacon.power self._power = tracker_beacon.power
class GeoRideSubscription: class GeoRideSubscription(metaclass=JsonMgtMetaClass):
""" Account object representation """ """ Account object representation """
def __init__(self, subscription_id, subscription_type, initial_date, next_payment_date, def __init__(self, subscription_id, subscription_type, initial_date, next_payment_date,
status, paused_since, cancel_requested, price, first_name, last_name, card_information): status, paused_since, cancel_requested, price, first_name, last_name, card_information):
@@ -956,21 +956,22 @@ class GeoRideSubscription:
@classmethod @classmethod
def from_json(cls, json): def from_json(cls, json):
"""return new object from_json""" """return new object from_json"""
card_info = GeoRideSubscription_CardInfo.from_json(json['cardInformation']) if cls.json_field_protect(json, 'cardInformation', None) is not None else {}
return GeoRideSubscription( return GeoRideSubscription(
json['id'], json['id'],
json['type'], json['type'],
json['initialDate'], cls.json_field_protect(json, 'initialDate'),
json['nextPaymentDate'], cls.json_field_protect(json, 'nextPaymentDate'),
json['status'], cls.json_field_protect(json, 'status'),
json['pausedSince'], cls.json_field_protect(json, 'pausedSince'),
json['cancelRequested'], cls.json_field_protect(json, 'cancelRequested'),
json['price'], cls.json_field_protect(json, 'price'),
json['firstName'], cls.json_field_protect(json, 'firstName'),
json['lastName'], cls.json_field_protect(json, 'lastName'),
GeoRideSubscription_CardInfo.from_json(json['cardInformation']) card_info
) )
class GeoRideSubscription_CardInfo: class GeoRideSubscription_CardInfo(metaclass=JsonMgtMetaClass):
""" Account object representation """ """ Account object representation """
def __init__(self, last_digits, expiry, brand): def __init__(self, last_digits, expiry, brand):
self._last_digits = last_digits self._last_digits = last_digits
@@ -997,9 +998,9 @@ class GeoRideSubscription_CardInfo:
def from_json(cls, json): def from_json(cls, json):
"""return new object from_json""" """return new object from_json"""
return GeoRideSubscription_CardInfo( return GeoRideSubscription_CardInfo(
json['lastDigits'], cls.json_field_protect(json, 'lastDigits'),
json['expiry'], cls.json_field_protect(json, 'expiry'),
json['brand'] cls.json_field_protect(json, 'brand')
) )
class GeoRideAccount: class GeoRideAccount:

View File

@@ -112,19 +112,3 @@ class GeoRideSocket():
def disconnect(self): def disconnect(self):
"""disconnect from the georide socket""" """disconnect from the georide socket"""
sio.disconnect() sio.disconnect()
#TODO: remove in v0.8.0
class GeorideSocket(GeoRideSocket):
""" Trip object representation """
def __init_subclass__(cls, **kwargs):
"""Print deprecation warning."""
super().__init_subclass__(**kwargs)
_LOGGER.warning(
"GeorideSocket is deprecated, modify %s to use GeoRideSocket",
cls.__name__,
)
def __init__(self, *argv):
"""Print deprecation warning."""
super().__init__(*argv)
_LOGGER.warning("GeorideSocket is deprecated, modify your code to use GeoRideSocket")

View File

@@ -19,7 +19,7 @@ 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.2', version='0.8.4',
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',