pycupra 0.0.8__py3-none-any.whl → 0.0.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pycupra/__version__.py CHANGED
@@ -3,4 +3,4 @@ pycupra - A Python 3 library for interacting with the My Cupra/My Seat portal.
3
3
 
4
4
  For more details and documentation, visit the github page at https://github.com/WulfgarW/pycupra
5
5
  """
6
- __version__ = "0.0.8"
6
+ __version__ = "0.0.9"
pycupra/vehicle.py CHANGED
@@ -107,7 +107,8 @@ class Vehicle:
107
107
  self._relevantCapabilties[id].update(data)
108
108
 
109
109
 
110
- await self.get_trip_statistic()
110
+ #await self.get_trip_statistic() # in full update
111
+
111
112
  # Get URLs for model image
112
113
  self._modelimages = await self.get_modelimageurl()
113
114
 
@@ -132,6 +133,7 @@ class Vehicle:
132
133
  await asyncio.gather(
133
134
  self.get_charger(),
134
135
  self.get_basiccardata(),
136
+ self.get_statusreport(),
135
137
  return_exceptions=True
136
138
  )
137
139
 
@@ -146,9 +148,9 @@ class Vehicle:
146
148
  await asyncio.gather(
147
149
  self.get_preheater(),
148
150
  self.get_climater(),
149
- #self.get_trip_statistic(), # commented out, because getting the trip statistic in discover() should be sufficient
151
+ self.get_trip_statistic(),
150
152
  self.get_position(),
151
- self.get_statusreport(),
153
+ self.get_maintenance(),
152
154
  self.get_vehicleHealthWarnings(),
153
155
  self.get_departure_timers(),
154
156
  self.get_departure_profiles(),
@@ -251,6 +253,9 @@ class Vehicle:
251
253
  self._states.update(data)
252
254
  else:
253
255
  _LOGGER.debug('Could not fetch status report')
256
+
257
+ async def get_maintenance(self):
258
+ """Fetch maintenance data if function is enabled."""
254
259
  if self._relevantCapabilties.get('vehicleHealthInspection', {}).get('active', False):
255
260
  data = await self._connection.getMaintenance(self.vin, self._apibase)
256
261
  if data:
@@ -1006,7 +1011,25 @@ class Vehicle:
1006
1011
  'status': response.get('state', 'Unknown'),
1007
1012
  'id': response.get('id', 0),
1008
1013
  }
1009
- return True
1014
+ # Update the lock data and check, if they have changed as expected
1015
+ retry = 0
1016
+ actionSuccessful = False
1017
+ while not actionSuccessful and retry < 2:
1018
+ await asyncio.sleep(15)
1019
+ await self.get_statusreport()
1020
+ if action == 'lock':
1021
+ if self.door_locked:
1022
+ actionSuccessful = True
1023
+ else:
1024
+ if not self.door_locked:
1025
+ actionSuccessful = True
1026
+ retry = retry +1
1027
+ if actionSuccessful:
1028
+ _LOGGER.debug('POST request for lock/unlock successful. New status as expected.')
1029
+ self._requests.get('lock', {}).pop('id')
1030
+ return True
1031
+ _LOGGER.error('Response to POST request seemed successful but the lock status did not change as expected.')
1032
+ return False
1010
1033
  except (SeatInvalidRequestException, SeatException):
1011
1034
  raise
1012
1035
  except Exception as error:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycupra
3
- Version: 0.0.8
3
+ Version: 0.0.9
4
4
  Summary: A library to read and send vehicle data via Cupra/Seat portal using the same API calls as the MyCupra/MySeat mobile app.
5
5
  Home-page: https://github.com/WulfgarW/pycupra
6
6
  Author: WulfgarW
@@ -1,13 +1,13 @@
1
1
  pycupra/__init__.py,sha256=VPzUfKd5mBFD1UERNV61FbGHih5dQPupLgIfYtmIUi4,230
2
- pycupra/__version__.py,sha256=g845Cq_z0hjlwG9RG4nM9vit4t_cEbb5HkAMZ7Iav3Y,207
2
+ pycupra/__version__.py,sha256=4zEieEZtA29wLX4UeSljs9SWOL-1Feo5CB4ZC3aPdrY,207
3
3
  pycupra/connection.py,sha256=fNjyrj6nBLOfEpKcygDs47UFlWjmR4tgJa1KPLLNZLU,82411
4
4
  pycupra/const.py,sha256=VEYH8TUsJGJwBwloaajwoElYd0qxE7oesvoagvDdE-4,10161
5
5
  pycupra/dashboard.py,sha256=Dqs4qDF-rEoYXoS7NrNsvRMsCGzoAjVUEbfTSOdDAXo,41310
6
6
  pycupra/exceptions.py,sha256=Nq_F79GP8wjHf5lpvPy9TbSIrRHAJrFMo0T1N9TcgSQ,2917
7
7
  pycupra/utilities.py,sha256=cH4MiIzT2WlHgmnl_E7rR0R5LvCXfDNvirJolct50V8,2563
8
- pycupra/vehicle.py,sha256=J5jUAseVTtb9HK0-RvCi-VzkJ1z0h4Phn_Tgno6Sgzk,122420
9
- pycupra-0.0.8.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
10
- pycupra-0.0.8.dist-info/METADATA,sha256=Z8QMsbcu3IXFWgeNLKTk91sGirawTdhXhEoCqFvhAPs,2578
11
- pycupra-0.0.8.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
12
- pycupra-0.0.8.dist-info/top_level.txt,sha256=9Lbj_jG4JvpGwt6K3AwhWFc0XieDnuHFOP4x44wSXSQ,8
13
- pycupra-0.0.8.dist-info/RECORD,,
8
+ pycupra/vehicle.py,sha256=Xdd07m-KKDaV7fA4c9hF5ohSg0y_UPoiR8o9ykfJyzE,123464
9
+ pycupra-0.0.9.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
10
+ pycupra-0.0.9.dist-info/METADATA,sha256=vXsQzwLRLEE0qYRyabQPpvAVsokywfRS0UDg3NlC1L4,2578
11
+ pycupra-0.0.9.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
12
+ pycupra-0.0.9.dist-info/top_level.txt,sha256=9Lbj_jG4JvpGwt6K3AwhWFc0XieDnuHFOP4x44wSXSQ,8
13
+ pycupra-0.0.9.dist-info/RECORD,,