tesla-fleet-api 1.0.17__py3-none-any.whl → 1.1.0__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.
Files changed (25) hide show
  1. tesla_fleet_api/__init__.py +1 -1
  2. tesla_fleet_api/exceptions.py +26 -6
  3. tesla_fleet_api/tesla/vehicle/commands.py +6 -4
  4. tesla_fleet_api/tesla/vehicle/fleet.py +5 -2
  5. tesla_fleet_api/tesla/vehicle/proto/car_server_pb2.py +310 -160
  6. tesla_fleet_api/tesla/vehicle/proto/car_server_pb2.pyi +823 -7
  7. tesla_fleet_api/tesla/vehicle/proto/common_pb2.py +4 -2
  8. tesla_fleet_api/tesla/vehicle/proto/common_pb2.pyi +2 -1
  9. tesla_fleet_api/tesla/vehicle/proto/errors_pb2.py +4 -2
  10. tesla_fleet_api/tesla/vehicle/proto/keys_pb2.py +4 -2
  11. tesla_fleet_api/tesla/vehicle/proto/managed_charging_pb2.py +4 -2
  12. tesla_fleet_api/tesla/vehicle/proto/signatures_pb2.py +4 -2
  13. tesla_fleet_api/tesla/vehicle/proto/signatures_pb2.pyi +2 -1
  14. tesla_fleet_api/tesla/vehicle/proto/universal_message_pb2.py +4 -2
  15. tesla_fleet_api/tesla/vehicle/proto/universal_message_pb2.pyi +2 -1
  16. tesla_fleet_api/tesla/vehicle/proto/vcsec_pb2.py +27 -25
  17. tesla_fleet_api/tesla/vehicle/proto/vcsec_pb2.pyi +53 -2
  18. tesla_fleet_api/tesla/vehicle/proto/vehicle_pb2.py +4 -2
  19. tesla_fleet_api/tesla/vehicle/proto/vehicle_pb2.pyi +14 -13
  20. tesla_fleet_api/teslemetry/teslemetry.py +1 -1
  21. {tesla_fleet_api-1.0.17.dist-info → tesla_fleet_api-1.1.0.dist-info}/METADATA +1 -2
  22. {tesla_fleet_api-1.0.17.dist-info → tesla_fleet_api-1.1.0.dist-info}/RECORD +25 -25
  23. {tesla_fleet_api-1.0.17.dist-info → tesla_fleet_api-1.1.0.dist-info}/WHEEL +1 -1
  24. {tesla_fleet_api-1.0.17.dist-info → tesla_fleet_api-1.1.0.dist-info}/licenses/LICENSE +0 -0
  25. {tesla_fleet_api-1.0.17.dist-info → tesla_fleet_api-1.1.0.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  """Tesla Fleet API"""
2
2
 
3
3
  __author__ = "hello@teslemetry.com"
4
- __version__ = "1.0.17"
4
+ __version__ = "1.1.0"
5
5
 
6
6
  from tesla_fleet_api.tesla.fleet import TeslaFleetApi
7
7
  from tesla_fleet_api.tesla.bluetooth import TeslaBluetooth
@@ -963,13 +963,30 @@ class WhitelistOperationServiceKeyAttemptingToAddServiceTechOutsideServiceMode(W
963
963
  message = "Service key attempting to add service tech outside service mode"
964
964
  code = 22
965
965
 
966
- # No idea what 23 & 24 are
966
+ class WhitelistOperationCouldNotStartLocalEntityAuth(WhitelistOperationStatus):
967
+ message = "Could not start local entity authentication"
968
+ code = 23
969
+
970
+ class WhitelistOperationLocalEntityAuthFailedUIDenied(WhitelistOperationStatus):
971
+ message = "Local entity authentication failed - UI denied"
972
+ code = 24
967
973
 
968
- class WhitelistOperationServiceAuthorizationRequestTimedOut(WhitelistOperationStatus):
969
- # This is observed but not documented
974
+ class WhitelistOperationLocalEntityAuthFailedTimedOutWaitingForTap(WhitelistOperationStatus):
970
975
  message = "Authorization request timed out"
971
976
  code = 25
972
977
 
978
+ class WhitelistOperationLocalEntityAuthFailedTimedOutWaitingForUIAck(WhitelistOperationStatus):
979
+ message = "Local entity authentication failed - timed out waiting for UI acknowledgement"
980
+ code = 26
981
+
982
+ class WhitelistOperationLocalEntityAuthFailedValetMode(WhitelistOperationStatus):
983
+ message = "Local entity authentication failed - valet mode"
984
+ code = 27
985
+
986
+ class WhitelistOperationLocalEntityAuthFailedCancelled(WhitelistOperationStatus):
987
+ message = "Local entity authentication failed - cancelled"
988
+ code = 28
989
+
973
990
 
974
991
  WHITELIST_OPERATION_STATUS = [
975
992
  None,
@@ -995,9 +1012,12 @@ WHITELIST_OPERATION_STATUS = [
995
1012
  WhitelistOperationAttemptingToAddKeyWithServiceRole,
996
1013
  WhitelistOperationNonServiceKeyAttemptingToAddServiceTech,
997
1014
  WhitelistOperationServiceKeyAttemptingToAddServiceTechOutsideServiceMode,
998
- WhitelistOperationStatus,
999
- WhitelistOperationStatus,
1000
- WhitelistOperationServiceAuthorizationRequestTimedOut
1015
+ WhitelistOperationCouldNotStartLocalEntityAuth,
1016
+ WhitelistOperationLocalEntityAuthFailedUIDenied,
1017
+ WhitelistOperationLocalEntityAuthFailedTimedOutWaitingForTap,
1018
+ WhitelistOperationLocalEntityAuthFailedTimedOutWaitingForUIAck,
1019
+ WhitelistOperationLocalEntityAuthFailedValetMode,
1020
+ WhitelistOperationLocalEntityAuthFailedCancelled
1001
1021
  ]
1002
1022
 
1003
1023
 
@@ -1174,14 +1174,16 @@ class Commands(Vehicle):
1174
1174
  )
1175
1175
  )
1176
1176
 
1177
- async def set_valet_mode(self, on: bool, password: str | int) -> dict[str, Any]:
1177
+ async def set_valet_mode(self, on: bool, password: str | int | None = None) -> dict[str, Any]:
1178
1178
  """Turns on Valet Mode and sets a four-digit passcode that must then be entered to disable Valet Mode."""
1179
+ action = VehicleControlSetValetModeAction(on=on)
1180
+ if password is not None:
1181
+ action.password = str(password)
1182
+
1179
1183
  return await self._sendInfotainment(
1180
1184
  Action(
1181
1185
  vehicleAction=VehicleAction(
1182
- vehicleControlSetValetModeAction=VehicleControlSetValetModeAction(
1183
- on=on, password=str(password)
1184
- )
1186
+ vehicleControlSetValetModeAction=action
1185
1187
  )
1186
1188
  )
1187
1189
  )
@@ -475,13 +475,16 @@ class VehicleFleet(Vehicle):
475
475
  )
476
476
 
477
477
  async def set_valet_mode(
478
- self, on: bool, password: str | int
478
+ self, on: bool, password: str | int | None = None
479
479
  ) -> dict[str, Any]:
480
480
  """Turns on Valet Mode and sets a four-digit passcode that must then be entered to disable Valet Mode."""
481
+ json_data: dict[str,Any] = {"on": on}
482
+ if password is not None:
483
+ json_data["password"] = str(password)
481
484
  return await self._request(
482
485
  Method.POST,
483
486
  f"api/1/vehicles/{self.vin}/command/set_valet_mode",
484
- json={"on": on, "password": str(password)},
487
+ json=json_data,
485
488
  )
486
489
 
487
490
  async def set_vehicle_name(