tesla-fleet-api 0.7.8__py3-none-any.whl → 0.8.1__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- tesla_fleet_api/__init__.py +2 -0
- tesla_fleet_api/const.py +1 -1
- tesla_fleet_api/energyspecific.py +2 -2
- tesla_fleet_api/exceptions.py +163 -0
- tesla_fleet_api/pb2/__init__.py +0 -0
- tesla_fleet_api/pb2/__init__.pyi +0 -0
- tesla_fleet_api/pb2/car_server_pb2.py +332 -0
- tesla_fleet_api/pb2/common_pb2.py +47 -0
- tesla_fleet_api/pb2/errors_pb2.py +29 -0
- tesla_fleet_api/pb2/keys_pb2.py +23 -0
- tesla_fleet_api/pb2/signatures_pb2.py +74 -0
- tesla_fleet_api/pb2/universal_message_pb2.py +80 -0
- tesla_fleet_api/pb2/vcsec_pb2.py +245 -0
- tesla_fleet_api/pb2/vehicle_pb2.py +28 -0
- tesla_fleet_api/teslafleetapi.py +40 -1
- tesla_fleet_api/teslemetry.py +22 -13
- tesla_fleet_api/vehicle.py +9 -1
- tesla_fleet_api/vehiclesigned.py +1074 -0
- {tesla_fleet_api-0.7.8.dist-info → tesla_fleet_api-0.8.1.dist-info}/METADATA +1 -1
- tesla_fleet_api-0.8.1.dist-info/RECORD +32 -0
- {tesla_fleet_api-0.7.8.dist-info → tesla_fleet_api-0.8.1.dist-info}/WHEEL +1 -1
- tesla_fleet_api-0.7.8.dist-info/RECORD +0 -21
- {tesla_fleet_api-0.7.8.dist-info → tesla_fleet_api-0.8.1.dist-info}/LICENSE +0 -0
- {tesla_fleet_api-0.7.8.dist-info → tesla_fleet_api-0.8.1.dist-info}/top_level.txt +0 -0
tesla_fleet_api/vehicle.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
from typing import Any, List, TYPE_CHECKING
|
3
|
+
from cryptography.hazmat.primitives.asymmetric import ec
|
3
4
|
from .const import (
|
4
5
|
Method,
|
5
6
|
Trunk,
|
@@ -13,6 +14,7 @@ from .const import (
|
|
13
14
|
Level,
|
14
15
|
)
|
15
16
|
from .vehiclespecific import VehicleSpecific
|
17
|
+
from .vehiclesigned import VehicleSigned
|
16
18
|
|
17
19
|
if TYPE_CHECKING:
|
18
20
|
from .teslafleetapi import TeslaFleetApi
|
@@ -31,6 +33,12 @@ class Vehicle:
|
|
31
33
|
"""Creates a class for each vehicle."""
|
32
34
|
return VehicleSpecific(self, vin)
|
33
35
|
|
36
|
+
def specific_signed(
|
37
|
+
self, vin: str, private_key: ec.EllipticCurvePrivateKey | None = None
|
38
|
+
) -> VehicleSigned:
|
39
|
+
"""Creates a class for each vehicle with command signing."""
|
40
|
+
return VehicleSigned(self, vin, private_key)
|
41
|
+
|
34
42
|
def pre2021(self, vin: str) -> bool:
|
35
43
|
"""Checks if a vehicle is a pre-2021 model S or X."""
|
36
44
|
return vin[9] <= "L" and vin[3] in ["S", "X"]
|
@@ -719,7 +727,7 @@ class Vehicle:
|
|
719
727
|
return await self._request(
|
720
728
|
Method.POST,
|
721
729
|
f"api/1/vehicles/{vehicle_tag}/signed_command",
|
722
|
-
{"routable_message": routable_message},
|
730
|
+
json={"routable_message": routable_message},
|
723
731
|
)
|
724
732
|
|
725
733
|
async def vehicle(self, vehicle_tag: str | int) -> dict[str, Any]:
|