pycupra 0.1.4__tar.gz → 0.1.6__tar.gz

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.
Files changed (38) hide show
  1. {pycupra-0.1.4/pycupra.egg-info → pycupra-0.1.6}/PKG-INFO +1 -1
  2. {pycupra-0.1.4 → pycupra-0.1.6}/example/PyCupra.py +32 -19
  3. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/__version__.py +1 -1
  4. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/connection.py +1858 -1799
  5. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/dashboard.py +2 -0
  6. pycupra-0.1.6/pycupra/firebase.py +90 -0
  7. pycupra-0.1.6/pycupra/firebase_messaging/android_checkin.proto +96 -0
  8. pycupra-0.1.6/pycupra/firebase_messaging/checkin.proto +155 -0
  9. pycupra-0.1.6/pycupra/firebase_messaging/mcs.proto +328 -0
  10. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/utilities.py +116 -116
  11. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/vehicle.py +96 -15
  12. {pycupra-0.1.4 → pycupra-0.1.6/pycupra.egg-info}/PKG-INFO +1 -1
  13. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra.egg-info/SOURCES.txt +3 -0
  14. pycupra-0.1.4/pycupra/firebase.py +0 -73
  15. {pycupra-0.1.4 → pycupra-0.1.6}/.gitignore +0 -0
  16. {pycupra-0.1.4 → pycupra-0.1.6}/LICENSE +0 -0
  17. {pycupra-0.1.4 → pycupra-0.1.6}/README.md +0 -0
  18. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/__init__.py +0 -0
  19. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/const.py +0 -0
  20. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/exceptions.py +0 -0
  21. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/firebase_messaging/__init__.py +0 -0
  22. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/firebase_messaging/android_checkin_pb2.py +0 -0
  23. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/firebase_messaging/android_checkin_pb2.pyi +0 -0
  24. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/firebase_messaging/checkin_pb2.py +0 -0
  25. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/firebase_messaging/checkin_pb2.pyi +0 -0
  26. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/firebase_messaging/const.py +0 -0
  27. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/firebase_messaging/fcmpushclient.py +0 -0
  28. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/firebase_messaging/fcmregister.py +0 -0
  29. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/firebase_messaging/mcs_pb2.py +0 -0
  30. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/firebase_messaging/mcs_pb2.pyi +0 -0
  31. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra/firebase_messaging/py.typed +0 -0
  32. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra.egg-info/dependency_links.txt +0 -0
  33. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra.egg-info/requires.txt +0 -0
  34. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra.egg-info/top_level.txt +0 -0
  35. {pycupra-0.1.4 → pycupra-0.1.6}/pycupra_credentials.json.demo +0 -0
  36. {pycupra-0.1.4 → pycupra-0.1.6}/requirements.txt +0 -0
  37. {pycupra-0.1.4 → pycupra-0.1.6}/setup.cfg +0 -0
  38. {pycupra-0.1.4 → pycupra-0.1.6}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycupra
3
- Version: 0.1.4
3
+ Version: 0.1.6
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
@@ -177,7 +177,18 @@ async def demo_set_charger_current(vehicle, value="reduced"):
177
177
  print('########################################')
178
178
  print('# Change charging current #')
179
179
  print('########################################')
180
- success= await vehicle.set_charger_current(value) # value = "max" or "reduced".
180
+ success= await vehicle.set_charger_current(value)
181
+ if success:
182
+ print(" Request completed successfully.")
183
+ else:
184
+ print(" Request failed.")
185
+ return success
186
+
187
+ async def demo_set_charger_target_soc(vehicle, value=80):
188
+ print('########################################')
189
+ print('# Change target state of charge #')
190
+ print('########################################')
191
+ success= await vehicle.set_charger_target_soc(value)
181
192
  if success:
182
193
  print(" Request completed successfully.")
183
194
  else:
@@ -373,11 +384,11 @@ async def main():
373
384
  raise
374
385
  async with ClientSession(headers={'Connection': 'keep-alive'}) as session:
375
386
  print('')
376
- print('########################################')
377
- print('# Logging on to seat.cloud.vwgroup.com #')
378
- print('########################################')
379
- print(f"Initiating new session to Seat Cloud with {credentials.get('username')} as username")
380
- connection = Connection(session, BRAND, credentials.get('username'), credentials.get('password'), PRINTRESPONSE, nightlyUpdateReduction=False)
387
+ print('######################################################')
388
+ print('# Logging on to ola.prod.code.seat.cloud.vwgroup.com #')
389
+ print('######################################################')
390
+ print(f"Initiating new session to Cupra/Seat Cloud with {credentials.get('username')} as username")
391
+ connection = Connection(session, BRAND, credentials.get('username'), credentials.get('password'), PRINTRESPONSE, nightlyUpdateReduction=False, anonymise=True)
381
392
  print("Attempting to login to the Seat Cloud service")
382
393
  print(datetime.now())
383
394
  if await connection.doLogin(tokenFile=TOKEN_FILE_NAME_AND_PATH, apiKey=credentials.get('apiKey',None)):
@@ -474,6 +485,7 @@ async def main():
474
485
  #print(f"Sleeping for {INTERVAL} seconds")
475
486
  #await asyncio.sleep(INTERVAL)
476
487
 
488
+ await connection.terminate()
477
489
  for vehicle in connection.vehicles:
478
490
  """print('')
479
491
  print(datetime.now())
@@ -532,35 +544,36 @@ async def main():
532
544
 
533
545
  # Examples for using set functions:
534
546
 
535
- #await demo_set_charger(vehicle, action = "start") # action = "start" or "stop"
536
- #await demo_set_charger_current(vehicle, value='reduced') # value = 1-255/Maximum/Reduced (PHEV: 252 for reduced and 254 for max, EV: Maximum/Reduced)
547
+ #await demo_set_charger(vehicle, action = "start") # action = "start" or "stop"
548
+ #await demo_set_charger_current(vehicle, value='reduced') # value = 1-255/Maximum/Reduced (PHEV: 252 for reduced and 254 for max, EV: Maximum/Reduced)
549
+ #await demo_set_charger_target_soc(vehicle, value=70) # value = 1-100
537
550
 
538
- #await demo_set_climatisation(vehicle, action = "start", temp=18.0) # action = "auxilliary", "electric" or "off". spin is S-PIN and only needed for aux heating
539
- #await demo_set_climatisation_temp(vehicle, temp = 18.0) # temp = integer from 16 to 30
551
+ #await demo_set_climatisation(vehicle, action = "start", temp=18.0) # action = "auxilliary", "electric" or "off". spin is S-PIN and only needed for aux heating
552
+ #await demo_set_climatisation_temp(vehicle, temp = 18.0) # temp = integer from 16 to 30
540
553
  #await demo_set_battery_climatisation(vehicle, mode=False) # mode = False or True
541
- #await demo_set_windowheating(vehicle, action = "stop") # action = "start" or "stop"
554
+ #await demo_set_windowheating(vehicle, action = "stop") # action = "start" or "stop"
542
555
 
543
- #await demo_set_timer_schedule(vehicle) # arguments id and schedule can be found in the demo function
544
- #await demo_set_timer_active(vehicle, id=3, action="off") # id = 1, 2, 3, action = "on" or "off".
545
- #await demo_set_charge_limit(vehicle, 30) # limit = PHEV: 0/10/20/30/40/50, EV: 50/60/70/80/90/100
556
+ #await demo_set_timer_schedule(vehicle) # arguments id and schedule can be found in the demo function
557
+ #await demo_set_timer_active(vehicle, id=3, action="off") # id = 1, 2, 3, action = "on" or "off".
558
+ #await demo_set_charge_limit(vehicle, 30) # limit = PHEV: 0/10/20/30/40/50, EV: 50/60/70/80/90/100
546
559
 
547
- #await demo_set_departure_profile_schedule(vehicle) # arguments id and schedule can be found in the demo function
560
+ #await demo_set_departure_profile_schedule(vehicle) # arguments id and schedule can be found in the demo function
548
561
  #await demo_set_departure_profile_active(vehicle, id=3, action="off") # id = 1, 2, 3, action = "on" or "off".
549
562
 
550
563
  #await demo_set_lock(vehicle,action = "lock",
551
564
  # spin = credentials.get('spin','')) # action = "unlock" or "lock". spin = SPIN, needed for both
552
565
 
553
- #await vehicle.set_pheater(mode = "heating", spin = "1234") # action = "heating", "ventilation" or "off". spin = SPIN, not needed for off
566
+ #await vehicle.set_pheater(mode = "heating", spin = "1234") # action = "heating", "ventilation" or "off". spin = SPIN, not needed for off
554
567
 
555
- #await demo_set_honkandflash(vehicle, action="flash") # action = "honkandflash" or "flash"
568
+ #await demo_set_honkandflash(vehicle, action="flash") # action = "honkandflash" or "flash"
556
569
 
557
- #await vehicle.set_refresh() # Takes no arguments, will trigger forced update
570
+ #await vehicle.set_refresh() # Takes no arguments, will trigger forced update
558
571
 
559
572
  #print(f"Sleeping for {2*INTERVAL} seconds")
560
573
  #await asyncio.sleep(2*INTERVAL)
561
574
  #await demo_show_last_honkandflash_info(vehicle) # Returns the info of the last honkandflash_action
562
575
 
563
- #await demo_send_destination(vehicle) # arguments can be found in the demo function
576
+ #await demo_send_destination(vehicle) # arguments can be found in the demo function
564
577
 
565
578
  print('########################################')
566
579
  print('# Export all attributes to file #')
@@ -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.4"
6
+ __version__ = "0.1.6"