Skip to content

Commit 6282ab5

Browse files
committed
pyrking only if requested
1 parent 348ee19 commit 6282ab5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

weconnect/domain.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class Domain(Enum):
1717
OIL_LEVEL = 'oilLevel'
1818
MEASUREMENTS = 'measurements'
1919
BATTERY_SUPPORT = 'batterySupport'
20+
PARKING = 'parking'
2021

2122
def __str__(self):
2223
return self.value

weconnect/elements/vehicle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ def updateStatus(self, updateCapabilities: bool = True, force: bool = False, #
302302
# Controls
303303
self.controls.update()
304304

305-
if not updateCapabilities or ('parkingPosition' in self.capabilities and self.capabilities['parkingPosition'].status.value is None):
305+
if (selective is None or any(x in selective for x in [Domain.ALL, Domain.PARKING])) \
306+
and (not updateCapabilities or ('parkingPosition' in self.capabilities and self.capabilities['parkingPosition'].status.value is None)):
306307
url = 'https://mobileapi.apps.emea.vwapps.io/vehicles/' + self.vin.value + '/parkingposition'
307308
data = self.weConnect.fetchData(url, force, allowEmpty=True, allowHttpError=True, allowedErrors=[codes['not_found'],
308309
codes['no_content'],

0 commit comments

Comments
 (0)