pycupra 0.1.9__py3-none-any.whl → 0.1.10__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.9"
6
+ __version__ = "0.1.10"
pycupra/dashboard.py CHANGED
@@ -1286,7 +1286,7 @@ def create_instruments():
1286
1286
  ),
1287
1287
  Sensor(
1288
1288
  attr="trip_last_cycle_average_electric_consumption",
1289
- name="Last cycle_average electric consumption",
1289
+ name="Last cycle average electric consumption",
1290
1290
  icon="mdi:car-battery",
1291
1291
  unit="kWh/100km",
1292
1292
  device_class="energy_distance"
pycupra/vehicle.py CHANGED
@@ -1309,7 +1309,7 @@ class Vehicle:
1309
1309
  _LOGGER.info('Remote honk and flash is not supported.')
1310
1310
  raise SeatInvalidRequestException('Remote honk and flash is not supported.')
1311
1311
  if self._requests['honkandflash'].get('id', False):
1312
- timestamp = self._requests.get('honkandflash', {}).get('timestamp', datetime.now() - timedelta(minutes=5))
1312
+ timestamp = self._requests.get('honkandflash', {}).get('timestamp', datetime.now() - timedelta(minutes=2))
1313
1313
  expired = datetime.now() - timedelta(minutes=1)
1314
1314
  if expired > timestamp:
1315
1315
  self._requests.get('honkandflash', {}).pop('id')
@@ -3335,6 +3335,10 @@ class Vehicle:
3335
3335
  #await self.get_statusreport() # Call not needed because it's part of updateCallback(2)
3336
3336
  if self.updateCallback:
3337
3337
  await self.updateCallback(2)
3338
+ else:
3339
+ _LOGGER.debug(f'It is now {datetime.now(tz=None)}. Last update of status report was at {self._last_get_statusreport}. So no need to update.')
3340
+ # Wait 2 seconds
3341
+ await asyncio.sleep(2)
3338
3342
  elif type == 'departure-times-updated':
3339
3343
  if self._requests.get('departuretimer', {}).get('id', None):
3340
3344
  openRequest= self._requests.get('departuretimer', {}).get('id', None)
@@ -3346,6 +3350,10 @@ class Vehicle:
3346
3350
  await self.get_departure_timers()
3347
3351
  if self.updateCallback:
3348
3352
  await self.updateCallback(2)
3353
+ else:
3354
+ _LOGGER.debug(f'It is now {datetime.now(tz=None)}. Last update of departure timers was at {self._last_get_departure_timers}. So no need to update.')
3355
+ # Wait 5 seconds
3356
+ await asyncio.sleep(5)
3349
3357
  elif type == 'departure-profiles-updated': # !!! Is this the right type?
3350
3358
  if self._requests.get('departureprofile', {}).get('id', None):
3351
3359
  openRequest= self._requests.get('departureprofile', {}).get('id', None)
@@ -3357,6 +3365,10 @@ class Vehicle:
3357
3365
  await self.get_departure_profiles()
3358
3366
  if self.updateCallback:
3359
3367
  await self.updateCallback(2)
3368
+ else:
3369
+ _LOGGER.debug(f'It is now {datetime.now(tz=None)}. Last update of departure profiles was at {self._last_get_departure_profiles}. So no need to update.')
3370
+ # Wait 5 seconds
3371
+ await asyncio.sleep(5)
3360
3372
  elif type in ('charging-status-changed', 'charging-started', 'charging-stopped', 'charging-settings-updated'):
3361
3373
  if self._requests.get('batterycharge', {}).get('id', None):
3362
3374
  openRequest= self._requests.get('batterycharge', {}).get('id', None)
@@ -3370,6 +3382,8 @@ class Vehicle:
3370
3382
  await self.updateCallback(2)
3371
3383
  else:
3372
3384
  _LOGGER.debug(f'It is now {datetime.now(tz=None)}. Last get_charger was at {self._last_get_charger}. So no need to update.')
3385
+ # Wait 5 seconds
3386
+ await asyncio.sleep(5)
3373
3387
  elif type in ('climatisation-status-changed','climatisation-started', 'climatisation-stopped', 'climatisation-settings-updated'):
3374
3388
  if self._requests.get('climatisation', {}).get('id', None):
3375
3389
  openRequest= self._requests.get('climatisation', {}).get('id', None)
@@ -3383,6 +3397,8 @@ class Vehicle:
3383
3397
  await self.updateCallback(2)
3384
3398
  else:
3385
3399
  _LOGGER.debug(f'It is now {datetime.now(tz=None)}. Last get_climater was at {self._last_get_climater}. So no need to update.')
3400
+ # Wait 5 seconds
3401
+ await asyncio.sleep(5)
3386
3402
  elif type in ('vehicle-area-alarm-vehicle-exits-zone-triggered', 'vehicle-area-alarm-vehicle-enters-zone-triggered'):
3387
3403
  #if self._last_get_position < datetime.now(tz=None) - timedelta(seconds= 30):
3388
3404
  # # Update position data only if the last one is older than timedelta
@@ -3415,8 +3431,19 @@ class Vehicle:
3415
3431
  # Do full update only if the last one is older than timedelta or if the notification belongs to an open request initiated by PyCupra
3416
3432
  if self.updateCallback:
3417
3433
  await self.updateCallback(1)
3434
+ else:
3435
+ _LOGGER.debug(f'It is now {datetime.now(tz=None)}. Last full update was at {self._last_full_update}. So no need to update.')
3436
+ # Wait 5 seconds
3437
+ await asyncio.sleep(2)
3438
+ elif type == 'vehicle-honk-and-flash-started':
3439
+ if self._requests.get('refresh', {}).get('id', None):
3440
+ openRequest= self._requests.get('refresh', {}).get('id', None)
3441
+ if openRequest == requestId:
3442
+ _LOGGER.debug(f'The notification closes an open request initiated by PyCupra.')
3443
+ self._requests.get('refresh', {}).pop('id')
3444
+ # Nothing else to do
3418
3445
  elif type in ('vehicle-area-alert-added', 'vehicle-area-alert-updated'):
3419
3446
  _LOGGER.info(f' Intentionally ignoring a notification of type \'{type}\')')
3420
3447
  else:
3421
- _LOGGER.warning(f' Don\'t know what to do with a notification of type \'{type}\')')
3448
+ _LOGGER.warning(f' Don\'t know what to do with a notification of type \'{type}\'. Please open an issue.)')
3422
3449
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycupra
3
- Version: 0.1.9
3
+ Version: 0.1.10
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=dcxJ-u8Zz6qTGBXri5kGr0y8fa_8l43365hGXeOK-zU,207
2
+ pycupra/__version__.py,sha256=iNTLfp1sP9QiXpXNuzpu0t6telggHRH9Vujsyf35j1Y,208
3
3
  pycupra/connection.py,sha256=Knu3vzokMRrsg9psjeD_r-2cl04ySJ1j7Mrn2g9mzdg,92941
4
4
  pycupra/const.py,sha256=5b4uuNUE1AGZHmqQfIZv-76Ad20mJTXXQPGI8TU6FfY,10631
5
- pycupra/dashboard.py,sha256=AlffEx8WmhLaSwX-eVcrOc54rUmwpzZUuR1fhruYkzI,45337
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=12pFVqgIRkPMJ9IoBt0TAuSS4RRQOdTCq4-ltNtbN9c,162376
9
+ pycupra/vehicle.py,sha256=SqaE1r2TPeDTKBt-VYktKeYw7tjeZ1VvlQVU9iwOHw0,164005
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.9.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
22
- pycupra-0.1.9.dist-info/METADATA,sha256=5LDPYAqO74WlAZanWVES__uzRngZlq2t_JS8cbABI9w,3757
23
- pycupra-0.1.9.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
24
- pycupra-0.1.9.dist-info/top_level.txt,sha256=9Lbj_jG4JvpGwt6K3AwhWFc0XieDnuHFOP4x44wSXSQ,8
25
- pycupra-0.1.9.dist-info/RECORD,,
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,,