tesla-fleet-api 0.9.6__tar.gz → 0.9.7__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. {tesla_fleet_api-0.9.6/tesla_fleet_api.egg-info → tesla_fleet_api-0.9.7}/PKG-INFO +1 -1
  2. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/setup.py +1 -1
  3. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/const.py +1 -1
  4. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/vehiclesigned.py +11 -18
  5. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7/tesla_fleet_api.egg-info}/PKG-INFO +1 -1
  6. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/LICENSE +0 -0
  7. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/README.md +0 -0
  8. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/setup.cfg +0 -0
  9. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/__init__.py +0 -0
  10. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/charging.py +0 -0
  11. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/energy.py +0 -0
  12. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/energyspecific.py +0 -0
  13. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/exceptions.py +0 -0
  14. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/partner.py +0 -0
  15. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/__init__.py +0 -0
  16. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/__init__.pyi +0 -0
  17. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/car_server_pb2.py +0 -0
  18. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/car_server_pb2.pyi +0 -0
  19. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/common_pb2.py +0 -0
  20. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/common_pb2.pyi +0 -0
  21. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/errors_pb2.py +0 -0
  22. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/errors_pb2.pyi +0 -0
  23. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/keys_pb2.py +0 -0
  24. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/keys_pb2.pyi +0 -0
  25. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/managed_charging_pb2.py +0 -0
  26. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/managed_charging_pb2.pyi +0 -0
  27. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/signatures_pb2.py +0 -0
  28. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/signatures_pb2.pyi +0 -0
  29. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/universal_message_pb2.py +0 -0
  30. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/universal_message_pb2.pyi +0 -0
  31. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/vcsec_pb2.py +0 -0
  32. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/vcsec_pb2.pyi +0 -0
  33. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/vehicle_pb2.py +0 -0
  34. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/pb2/vehicle_pb2.pyi +0 -0
  35. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/ratecalculator.py +0 -0
  36. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/teslafleetapi.py +0 -0
  37. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/teslafleetoauth.py +0 -0
  38. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/teslafleetopensource.py +0 -0
  39. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/teslemetry.py +0 -0
  40. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/tessie.py +0 -0
  41. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/user.py +0 -0
  42. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/vehicle.py +0 -0
  43. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api/vehiclespecific.py +0 -0
  44. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api.egg-info/SOURCES.txt +0 -0
  45. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api.egg-info/dependency_links.txt +0 -0
  46. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api.egg-info/requires.txt +0 -0
  47. {tesla_fleet_api-0.9.6 → tesla_fleet_api-0.9.7}/tesla_fleet_api.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tesla_fleet_api
3
- Version: 0.9.6
3
+ Version: 0.9.7
4
4
  Summary: Tesla Fleet API library for Python
5
5
  Home-page: https://github.com/Teslemetry/python-tesla-fleet-api
6
6
  Author: Brett Adams
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="tesla_fleet_api",
8
- version="0.9.6",
8
+ version="0.9.7",
9
9
  author="Brett Adams",
10
10
  author_email="hello@teslemetry.com",
11
11
  description="Tesla Fleet API library for Python",
@@ -3,7 +3,7 @@
3
3
  from enum import Enum
4
4
  import logging
5
5
 
6
- VERSION = "0.9.6"
6
+ VERSION = "0.9.7"
7
7
  LOGGER = logging.getLogger(__package__)
8
8
  SERVERS = {
9
9
  "na": "https://fleet-api.prd.na.vn.cloud.tesla.com",
@@ -36,7 +36,6 @@ from .pb2.car_server_pb2 import (
36
36
  Response,
37
37
  Action,
38
38
  MediaPlayAction,
39
- ResultReason,
40
39
  VehicleAction,
41
40
  VehicleControlFlashLightsAction,
42
41
  ChargingStartStopAction,
@@ -95,8 +94,6 @@ from .pb2.signatures_pb2 import (
95
94
  SIGNATURE_TYPE_HMAC_PERSONALIZED,
96
95
  TAG_DOMAIN,
97
96
  TAG_SIGNATURE_TYPE,
98
- KeyIdentity,
99
- SignatureData,
100
97
  SessionInfo,
101
98
  HMAC_Personalized_Signature_Data,
102
99
  TAG_PERSONALIZATION,
@@ -107,7 +104,6 @@ from .pb2.signatures_pb2 import (
107
104
  )
108
105
  from .pb2.common_pb2 import (
109
106
  Void,
110
- LatLong,
111
107
  PreconditioningTimes,
112
108
  OffPeakChargingTimes,
113
109
  # ChargeSchedule,
@@ -152,7 +148,7 @@ class Session:
152
148
 
153
149
  def get(self) -> HMAC_Personalized_Signature_Data:
154
150
  """Sign a command and return session metadata"""
155
- self.counter += 1
151
+ self.counter = self.counter+1
156
152
  return HMAC_Personalized_Signature_Data(
157
153
  epoch=self.epoch,
158
154
  counter=self.counter,
@@ -300,7 +296,7 @@ class VehicleSigned(VehicleSpecific):
300
296
  await sleep(2)
301
297
  return await self._sign(domain, command, attempt)
302
298
 
303
- if resp.HasField("signedMessageStatus"):
299
+ if resp.HasField("protobuf_message_as_bytes"):
304
300
  if(resp.from_destination.domain == DOMAIN_VEHICLE_SECURITY):
305
301
  vcsec = FromVCSECMessage.FromString(resp.protobuf_message_as_bytes)
306
302
  LOGGER.debug("VCSEC Response: %s", vcsec)
@@ -308,10 +304,10 @@ class VehicleSigned(VehicleSpecific):
308
304
  LOGGER.error("Command failed with reason: %s", vcsec.nominalError.genericError)
309
305
  return {
310
306
  "response": {
311
- "result": False,
312
- "reason": GenericError_E.Name(vcsec.nominalError.genericError)
307
+ "result": False,
308
+ "reason": GenericError_E.Name(vcsec.nominalError.genericError)
309
+ }
313
310
  }
314
- }
315
311
  elif vcsec.commandStatus.operationStatus == OPERATIONSTATUS_OK:
316
312
  return {"response": {"result": True, "reason": ""}}
317
313
  elif vcsec.commandStatus.operationStatus == OPERATIONSTATUS_WAIT:
@@ -323,7 +319,7 @@ class VehicleSigned(VehicleSpecific):
323
319
  await sleep(2)
324
320
  return await self._sign(domain, command, attempt)
325
321
  elif vcsec.commandStatus.operationStatus == OPERATIONSTATUS_ERROR:
326
- if(vcsec.commandStatus.signedMessageStatus):
322
+ if(resp.HasField("signedMessageStatus")):
327
323
  raise SIGNED_MESSAGE_INFORMATION_FAULTS[vcsec.commandStatus.signedMessageStatus.signedMessageInformation]
328
324
 
329
325
  elif(resp.from_destination.domain == DOMAIN_INFOTAINMENT):
@@ -345,7 +341,7 @@ class VehicleSigned(VehicleSpecific):
345
341
  }
346
342
  }
347
343
 
348
- return {"response": {"result": None, "reason": "No Response"}}
344
+ return {"response": {"result": True, "reason": ""}}
349
345
 
350
346
  async def actuate_trunk(self, which_trunk: Trunk | str) -> dict[str, Any]:
351
347
  """Controls the front or rear trunk."""
@@ -1023,6 +1019,7 @@ class VehicleSigned(VehicleSpecific):
1023
1019
  """Controls the panoramic sunroof on the Model S."""
1024
1020
  if isinstance(state, SunRoofCommand):
1025
1021
  state = state.value
1022
+ action = VehicleControlSunroofOpenCloseAction()
1026
1023
  match state:
1027
1024
  case "vent":
1028
1025
  action = VehicleControlSunroofOpenCloseAction(vent=Void())
@@ -1034,9 +1031,7 @@ class VehicleSigned(VehicleSpecific):
1034
1031
  return await self._sendInfotainment(
1035
1032
  Action(
1036
1033
  vehicleAction=VehicleAction(
1037
- vehicleControlSunroofOpenCloseAction=VehicleControlSunroofOpenCloseAction(
1038
- state=state
1039
- )
1034
+ vehicleControlSunroofOpenCloseAction=action
1040
1035
  )
1041
1036
  )
1042
1037
  )
@@ -1052,10 +1047,8 @@ class VehicleSigned(VehicleSpecific):
1052
1047
  """Turns on HomeLink (used to open and close garage doors)."""
1053
1048
  action = VehicleControlTriggerHomelinkAction()
1054
1049
  if lat is not None and lon is not None:
1055
- location = LatLong()
1056
- location.latitude = lat
1057
- location.longitude = lon
1058
- action.location = location
1050
+ action.location.latitude = lat
1051
+ action.location.longitude = lon
1059
1052
  if token is not None:
1060
1053
  action.token = token
1061
1054
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tesla_fleet_api
3
- Version: 0.9.6
3
+ Version: 0.9.7
4
4
  Summary: Tesla Fleet API library for Python
5
5
  Home-page: https://github.com/Teslemetry/python-tesla-fleet-api
6
6
  Author: Brett Adams
File without changes