pycupra 0.1.10__py3-none-any.whl → 0.1.11__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.1.10"
6
+ __version__ = "0.1.11"
pycupra/connection.py CHANGED
@@ -839,7 +839,12 @@ class Connection:
839
839
  if response.get('capabilities', False):
840
840
  vehicle["capabilities"]=response.get('capabilities')
841
841
  else:
842
- _LOGGER.warning(f"Failed to aquire capabilities information about vehicle with VIN {vehicle}")
842
+ _LOGGER.warning(f"Failed to aquire capabilities information about vehicle with VIN {vehicle}.")
843
+ if vehicle.get('capabilities',None)!=None:
844
+ _LOGGER.warning(f"Keeping the old capability information.")
845
+ else:
846
+ _LOGGER.warning(f"Initialising vehicle without capabilities.")
847
+ vehicle["capabilities"]=[]
843
848
  response = await self.get(eval(f"f'{API_CONNECTION}'"))
844
849
  #self._session_headers['Accept'] = 'application/json'
845
850
  if response.get('connection', False):
pycupra/vehicle.py CHANGED
@@ -107,29 +107,33 @@ class Vehicle:
107
107
  # return_exceptions=True
108
108
  #)
109
109
  # Extract information of relevant capabilities
110
- for capa in self._capabilities:
111
- id=capa.get('id', '')
112
- if self._relevantCapabilties.get(id, False):
113
- data={}
114
- data['active']=capa.get('active', False)
115
- if capa.get('user-enabled', False):
116
- data['reason']='user-enabled'
117
- else:
118
- data['reason']=capa.get('user-enabled', False)
119
- if capa.get('status', False):
120
- data['reason']=capa.get('status', '')
121
- if capa.get('parameters', False):
122
- if capa['parameters'].get('supportsCyclicTrips',False)==True or capa['parameters'].get('supportsCyclicTrips',False)=='true':
123
- data['supportsCyclicTrips']=True
124
- if capa['parameters'].get('supportsTargetStateOfCharge',False)==True or capa['parameters'].get('supportsTargetStateOfCharge',False)=='true':
125
- data['supportsTargetStateOfCharge']=True
126
- if capa['parameters'].get('supportsSingleTimer',False)==True or capa['parameters'].get('supportsSingleTimer',False)=='true':
127
- data['supportsSingleTimer']=True
128
- if capa['parameters'].get('supportsVehiclePositionedInProfileID',False)==True or capa['parameters'].get('supportsVehiclePositionedInProfileID',False)=='true':
129
- data['supportsVehiclePositionedInProfileID']=True
130
- if capa['parameters'].get('supportsTimerClimatisation',False)==True or capa['parameters'].get('supportsTimerClimatisation',False)=='true':
131
- data['supportsTimerClimatisation']=True
132
- self._relevantCapabilties[id].update(data)
110
+ if self._capabilities != None:
111
+ for capa in self._capabilities:
112
+ id=capa.get('id', '')
113
+ if self._relevantCapabilties.get(id, False):
114
+ data={}
115
+ data['active']=capa.get('active', False)
116
+ if capa.get('user-enabled', False):
117
+ data['reason']='user-enabled'
118
+ else:
119
+ data['reason']=capa.get('user-enabled', False)
120
+ if capa.get('status', False):
121
+ data['reason']=capa.get('status', '')
122
+ if capa.get('parameters', False):
123
+ if capa['parameters'].get('supportsCyclicTrips',False)==True or capa['parameters'].get('supportsCyclicTrips',False)=='true':
124
+ data['supportsCyclicTrips']=True
125
+ if capa['parameters'].get('supportsTargetStateOfCharge',False)==True or capa['parameters'].get('supportsTargetStateOfCharge',False)=='true':
126
+ data['supportsTargetStateOfCharge']=True
127
+ if capa['parameters'].get('supportsSingleTimer',False)==True or capa['parameters'].get('supportsSingleTimer',False)=='true':
128
+ data['supportsSingleTimer']=True
129
+ if capa['parameters'].get('supportsVehiclePositionedInProfileID',False)==True or capa['parameters'].get('supportsVehiclePositionedInProfileID',False)=='true':
130
+ data['supportsVehiclePositionedInProfileID']=True
131
+ if capa['parameters'].get('supportsTimerClimatisation',False)==True or capa['parameters'].get('supportsTimerClimatisation',False)=='true':
132
+ data['supportsTimerClimatisation']=True
133
+ self._relevantCapabilties[id].update(data)
134
+ else:
135
+ _LOGGER.warning(f"No capabilities information stored for vehicle with VIN {self.vin}")
136
+
133
137
 
134
138
 
135
139
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycupra
3
- Version: 0.1.10
3
+ Version: 0.1.11
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,12 +1,12 @@
1
1
  pycupra/__init__.py,sha256=p0880jPkLqOErX3u3qaLboBLOsEHFpe44axApdaGeqI,231
2
- pycupra/__version__.py,sha256=iNTLfp1sP9QiXpXNuzpu0t6telggHRH9Vujsyf35j1Y,208
3
- pycupra/connection.py,sha256=Knu3vzokMRrsg9psjeD_r-2cl04ySJ1j7Mrn2g9mzdg,92941
2
+ pycupra/__version__.py,sha256=CBIUvP7kBoPPjvk-0KBtBB_vkj1PUBBiezoLxmbQBps,208
3
+ pycupra/connection.py,sha256=-wfamvOPP0gDGo5Picd2zx9pHGs90vVqqCxp6SFn6PQ,93278
4
4
  pycupra/const.py,sha256=5b4uuNUE1AGZHmqQfIZv-76Ad20mJTXXQPGI8TU6FfY,10631
5
5
  pycupra/dashboard.py,sha256=_8qlVr1k_L3_7A7dDc9ugzpGK_Dg6UZgv_Pp-1pPaPE,45337
6
6
  pycupra/exceptions.py,sha256=Nq_F79GP8wjHf5lpvPy9TbSIrRHAJrFMo0T1N9TcgSQ,2917
7
7
  pycupra/firebase.py,sha256=lmI4a8f5VAlmHAqP2OiJWZhn7dmhyHkIBxL252qdtkA,3454
8
8
  pycupra/utilities.py,sha256=6sDxWP13-XtxmqhuBJBGdVbkj48BQ9AxFMrBPxH0J7g,2679
9
- pycupra/vehicle.py,sha256=SqaE1r2TPeDTKBt-VYktKeYw7tjeZ1VvlQVU9iwOHw0,164005
9
+ pycupra/vehicle.py,sha256=svuZ9xabbHa67saOQ1yGJcB8WCxV3zJmp32LFl8f_kQ,164254
10
10
  pycupra/firebase_messaging/__init__.py,sha256=oerLHWvEf4qRqu3GxSX6SLY_OYI430ydAiAhKtzyMEM,666
11
11
  pycupra/firebase_messaging/android_checkin_pb2.py,sha256=-U1oGroFt3KRuGDieae3iTcux6mAfx1TFkE1Q35ul2E,2849
12
12
  pycupra/firebase_messaging/android_checkin_pb2.pyi,sha256=7KL-zQIz2Zz7uftcLkv57Podzu-yk6trn50FN4X4A8E,9379
@@ -18,8 +18,8 @@ pycupra/firebase_messaging/fcmregister.py,sha256=yZngC-0ZfTygtjfdzg03OW_3xk2n_uS
18
18
  pycupra/firebase_messaging/mcs_pb2.py,sha256=nwXY7IDgLYPxgpSGs6wyTSyYDdomQsyGqH8R8EgODLg,7733
19
19
  pycupra/firebase_messaging/mcs_pb2.pyi,sha256=HfIhInC3wRg8_caKwUm-V3knE2jTdEQvBy6uXgQ5rHY,33959
20
20
  pycupra/firebase_messaging/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
- pycupra-0.1.10.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
22
- pycupra-0.1.10.dist-info/METADATA,sha256=jYBdK7eMDIGe3zFKtDrdIZWfm814Rd7CopUSHS0CtJg,3758
23
- pycupra-0.1.10.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
24
- pycupra-0.1.10.dist-info/top_level.txt,sha256=9Lbj_jG4JvpGwt6K3AwhWFc0XieDnuHFOP4x44wSXSQ,8
25
- pycupra-0.1.10.dist-info/RECORD,,
21
+ pycupra-0.1.11.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
22
+ pycupra-0.1.11.dist-info/METADATA,sha256=Xh1CM38qBXwPXTUvOIUEXVOMKKP0DgB6jkMlGLEQngA,3758
23
+ pycupra-0.1.11.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
24
+ pycupra-0.1.11.dist-info/top_level.txt,sha256=9Lbj_jG4JvpGwt6K3AwhWFc0XieDnuHFOP4x44wSXSQ,8
25
+ pycupra-0.1.11.dist-info/RECORD,,