tesla-fleet-api 1.0.1__py3-none-any.whl → 1.0.2__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.
- tesla_fleet_api/__init__.py +5 -7
- tesla_fleet_api/const.py +1 -1
- tesla_fleet_api/exceptions.py +16 -2
- tesla_fleet_api/tesla/__init__.py +3 -3
- tesla_fleet_api/tesla/bluetooth.py +7 -2
- tesla_fleet_api/tesla/charging.py +1 -1
- tesla_fleet_api/tesla/energysite.py +2 -2
- tesla_fleet_api/tesla/fleet.py +8 -8
- tesla_fleet_api/tesla/oauth.py +2 -2
- tesla_fleet_api/tesla/user.py +1 -1
- tesla_fleet_api/tesla/vehicle/__init__.py +4 -4
- tesla_fleet_api/tesla/vehicle/bluetooth.py +30 -23
- tesla_fleet_api/tesla/vehicle/commands.py +14 -16
- tesla_fleet_api/tesla/vehicle/fleet.py +3 -3
- tesla_fleet_api/tesla/vehicle/signed.py +6 -7
- tesla_fleet_api/tesla/vehicle/vehicle.py +1 -1
- tesla_fleet_api/tesla/vehicle/vehicles.py +5 -5
- tesla_fleet_api/teslemetry/__init__.py +1 -1
- tesla_fleet_api/teslemetry/teslemetry.py +6 -6
- tesla_fleet_api/teslemetry/vehicle.py +5 -7
- tesla_fleet_api/tessie/__init__.py +1 -1
- tesla_fleet_api/tessie/tessie.py +6 -6
- tesla_fleet_api/tessie/vehicle.py +3 -9
- {tesla_fleet_api-1.0.1.dist-info → tesla_fleet_api-1.0.2.dist-info}/METADATA +1 -1
- {tesla_fleet_api-1.0.1.dist-info → tesla_fleet_api-1.0.2.dist-info}/RECORD +28 -28
- {tesla_fleet_api-1.0.1.dist-info → tesla_fleet_api-1.0.2.dist-info}/LICENSE +0 -0
- {tesla_fleet_api-1.0.1.dist-info → tesla_fleet_api-1.0.2.dist-info}/WHEEL +0 -0
- {tesla_fleet_api-1.0.1.dist-info → tesla_fleet_api-1.0.2.dist-info}/top_level.txt +0 -0
tesla_fleet_api/__init__.py
CHANGED
@@ -1,15 +1,13 @@
|
|
1
|
-
from .tesla.fleet import TeslaFleetApi
|
2
|
-
from .tesla.bluetooth import TeslaBluetooth
|
3
|
-
from .tesla.oauth import TeslaFleetOAuth
|
4
|
-
from .
|
5
|
-
from .
|
6
|
-
from .tessie.tessie import Tessie
|
1
|
+
from tesla_fleet_api.tesla.fleet import TeslaFleetApi
|
2
|
+
from tesla_fleet_api.tesla.bluetooth import TeslaBluetooth
|
3
|
+
from tesla_fleet_api.tesla.oauth import TeslaFleetOAuth
|
4
|
+
from tesla_fleet_api.teslemetry.teslemetry import Teslemetry
|
5
|
+
from tesla_fleet_api.tessie.tessie import Tessie
|
7
6
|
|
8
7
|
__all__ = [
|
9
8
|
"TeslaFleetApi",
|
10
9
|
"TeslaBluetooth",
|
11
10
|
"TeslaFleetOAuth",
|
12
|
-
"TeslaFleetOpenSource",
|
13
11
|
"Teslemetry",
|
14
12
|
"Tessie",
|
15
13
|
]
|
tesla_fleet_api/const.py
CHANGED
tesla_fleet_api/exceptions.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import aiohttp
|
2
|
-
from .const import LOGGER
|
2
|
+
from tesla_fleet_api.const import LOGGER
|
3
3
|
|
4
4
|
|
5
5
|
class TeslaFleetError(BaseException):
|
@@ -856,6 +856,9 @@ SIGNED_MESSAGE_INFORMATION_FAULTS = [
|
|
856
856
|
class WhitelistOperationStatus(TeslaFleetError):
|
857
857
|
message = "Whitelist operation failed"
|
858
858
|
|
859
|
+
def __init__(self, message):
|
860
|
+
self.message = message
|
861
|
+
|
859
862
|
class WhitelistOperationUndocumentedError(WhitelistOperationStatus):
|
860
863
|
message = "Undocumented whitelist operation error"
|
861
864
|
code = 1
|
@@ -944,6 +947,14 @@ class WhitelistOperationServiceKeyAttemptingToAddServiceTechOutsideServiceMode(W
|
|
944
947
|
message = "Service key attempting to add service tech outside service mode"
|
945
948
|
code = 22
|
946
949
|
|
950
|
+
# No idea what 23 & 24 are
|
951
|
+
|
952
|
+
class WhitelistOperationServiceAuthorizationRequestTimedOut(WhitelistOperationStatus):
|
953
|
+
# This is observed but not documented
|
954
|
+
message = "Authorization request timed out"
|
955
|
+
code = 25
|
956
|
+
|
957
|
+
|
947
958
|
WHITELIST_OPERATION_STATUS = [
|
948
959
|
None,
|
949
960
|
WhitelistOperationUndocumentedError,
|
@@ -967,7 +978,10 @@ WHITELIST_OPERATION_STATUS = [
|
|
967
978
|
WhitelistOperationAttemptingToAddKeyWithoutRole,
|
968
979
|
WhitelistOperationAttemptingToAddKeyWithServiceRole,
|
969
980
|
WhitelistOperationNonServiceKeyAttemptingToAddServiceTech,
|
970
|
-
WhitelistOperationServiceKeyAttemptingToAddServiceTechOutsideServiceMode
|
981
|
+
WhitelistOperationServiceKeyAttemptingToAddServiceTechOutsideServiceMode,
|
982
|
+
WhitelistOperationStatus,
|
983
|
+
WhitelistOperationStatus,
|
984
|
+
WhitelistOperationServiceAuthorizationRequestTimedOut
|
971
985
|
]
|
972
986
|
|
973
987
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
"""Tesla Fleet API classes."""
|
2
2
|
|
3
|
-
from .fleet import TeslaFleetApi
|
4
|
-
from .bluetooth import TeslaBluetooth
|
5
|
-
from .oauth import TeslaFleetOAuth
|
3
|
+
from tesla_fleet_api.tesla.fleet import TeslaFleetApi
|
4
|
+
from tesla_fleet_api.tesla.bluetooth import TeslaBluetooth
|
5
|
+
from tesla_fleet_api.tesla.oauth import TeslaFleetOAuth
|
6
6
|
|
7
7
|
__all__ = [
|
8
8
|
"TeslaFleetApi",
|
@@ -2,8 +2,9 @@
|
|
2
2
|
|
3
3
|
import hashlib
|
4
4
|
import re
|
5
|
-
|
6
|
-
from .
|
5
|
+
|
6
|
+
from tesla_fleet_api.tesla.tesla import Tesla
|
7
|
+
from tesla_fleet_api.tesla.vehicle.bluetooth import VehicleBluetooth
|
7
8
|
|
8
9
|
class TeslaBluetooth(Tesla):
|
9
10
|
"""Class describing a Tesla Bluetooth connection."""
|
@@ -31,6 +32,10 @@ class Vehicles(dict[str, VehicleBluetooth]):
|
|
31
32
|
def __init__(self, parent: TeslaBluetooth):
|
32
33
|
self._parent = parent
|
33
34
|
|
35
|
+
def create(self, vin: str) -> VehicleBluetooth:
|
36
|
+
"""Creates a specific vehicle."""
|
37
|
+
return self.createBluetooth(vin)
|
38
|
+
|
34
39
|
def createBluetooth(self, vin: str) -> VehicleBluetooth:
|
35
40
|
"""Creates a specific vehicle."""
|
36
41
|
vehicle = VehicleBluetooth(self._parent, vin)
|
@@ -1,9 +1,9 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
from typing import Any, TYPE_CHECKING
|
3
|
-
from
|
3
|
+
from tesla_fleet_api.const import Method, EnergyOperationMode, EnergyExportMode, TeslaEnergyPeriod
|
4
4
|
|
5
5
|
if TYPE_CHECKING:
|
6
|
-
from . import TeslaFleetApi
|
6
|
+
from tesla_fleet_api.tesla.fleet import TeslaFleetApi
|
7
7
|
|
8
8
|
class EnergySite:
|
9
9
|
"""Class describing the Tesla Fleet API partner endpoints"""
|
tesla_fleet_api/tesla/fleet.py
CHANGED
@@ -4,14 +4,14 @@ from json import dumps
|
|
4
4
|
from typing import Any, Awaitable
|
5
5
|
import aiohttp
|
6
6
|
|
7
|
-
from .tesla import Tesla
|
8
|
-
from
|
9
|
-
from
|
10
|
-
from .charging import Charging
|
11
|
-
from .energysite import EnergySites
|
12
|
-
from .partner import Partner
|
13
|
-
from .user import User
|
14
|
-
from .vehicle.vehicles import Vehicles
|
7
|
+
from tesla_fleet_api.tesla.tesla import Tesla
|
8
|
+
from tesla_fleet_api.exceptions import raise_for_status, InvalidRegion, LibraryError, ResponseError
|
9
|
+
from tesla_fleet_api.const import SERVERS, Method, LOGGER, VERSION
|
10
|
+
from tesla_fleet_api.tesla.charging import Charging
|
11
|
+
from tesla_fleet_api.tesla.energysite import EnergySites
|
12
|
+
from tesla_fleet_api.tesla.partner import Partner
|
13
|
+
from tesla_fleet_api.tesla.user import User
|
14
|
+
from tesla_fleet_api.tesla.vehicle.vehicles import Vehicles
|
15
15
|
|
16
16
|
|
17
17
|
# Based on https://developer.tesla.com/docs/fleet-api
|
tesla_fleet_api/tesla/oauth.py
CHANGED
@@ -2,8 +2,8 @@ from typing import Any
|
|
2
2
|
import aiohttp
|
3
3
|
import time
|
4
4
|
|
5
|
-
from . import TeslaFleetApi
|
6
|
-
from
|
5
|
+
from tesla_fleet_api.tesla import TeslaFleetApi
|
6
|
+
from tesla_fleet_api.const import Scope, SERVERS, Method
|
7
7
|
|
8
8
|
|
9
9
|
class TeslaFleetOAuth(TeslaFleetApi):
|
tesla_fleet_api/tesla/user.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
"""Tesla Fleet API classes."""
|
2
2
|
|
3
|
-
from .vehicles import Vehicles
|
4
|
-
from .fleet import VehicleFleet
|
5
|
-
from .bluetooth import VehicleBluetooth
|
6
|
-
from .signed import VehicleSigned
|
3
|
+
from tesla_fleet_api.tesla.vehicle.vehicles import Vehicles
|
4
|
+
from tesla_fleet_api.tesla.vehicle.fleet import VehicleFleet
|
5
|
+
from tesla_fleet_api.tesla.vehicle.bluetooth import VehicleBluetooth
|
6
|
+
from tesla_fleet_api.tesla.vehicle.signed import VehicleSigned
|
7
7
|
|
8
8
|
__all__ = [
|
9
9
|
"Vehicles",
|
@@ -12,34 +12,36 @@ from cryptography.hazmat.primitives.asymmetric import ec
|
|
12
12
|
|
13
13
|
from tesla_fleet_api.tesla.vehicle.proto.keys_pb2 import Role
|
14
14
|
|
15
|
-
from .commands import Commands
|
15
|
+
from tesla_fleet_api.tesla.vehicle.commands import Commands
|
16
16
|
|
17
|
-
from
|
17
|
+
from tesla_fleet_api.const import (
|
18
18
|
LOGGER,
|
19
19
|
)
|
20
|
-
from
|
20
|
+
from tesla_fleet_api.exceptions import (
|
21
21
|
MESSAGE_FAULTS,
|
22
22
|
WHITELIST_OPERATION_STATUS,
|
23
|
+
WhitelistOperationStatus,
|
23
24
|
)
|
24
25
|
|
25
26
|
# Protocol
|
26
|
-
from .proto.car_server_pb2 import (
|
27
|
+
from tesla_fleet_api.tesla.vehicle.proto.car_server_pb2 import (
|
27
28
|
Response,
|
28
29
|
)
|
29
|
-
from .proto.signatures_pb2 import (
|
30
|
+
from tesla_fleet_api.tesla.vehicle.proto.signatures_pb2 import (
|
30
31
|
SessionInfo,
|
31
32
|
)
|
32
|
-
from .proto.universal_message_pb2 import (
|
33
|
+
from tesla_fleet_api.tesla.vehicle.proto.universal_message_pb2 import (
|
33
34
|
Destination,
|
34
35
|
Domain,
|
35
36
|
RoutableMessage,
|
36
37
|
)
|
37
|
-
from .proto.vcsec_pb2 import (
|
38
|
+
from tesla_fleet_api.tesla.vehicle.proto.vcsec_pb2 import (
|
38
39
|
FromVCSECMessage,
|
39
40
|
KeyFormFactor,
|
40
41
|
KeyMetadata,
|
41
42
|
PermissionChange,
|
42
43
|
PublicKey,
|
44
|
+
RKEAction_E,
|
43
45
|
UnsignedMessage,
|
44
46
|
WhitelistOperation,
|
45
47
|
|
@@ -51,7 +53,7 @@ READ_UUID = "00000213-b2d1-43f0-9b88-960cebf8b91e"
|
|
51
53
|
VERSION_UUID = "00000214-b2d1-43f0-9b88-960cebf8b91e"
|
52
54
|
|
53
55
|
if TYPE_CHECKING:
|
54
|
-
from
|
56
|
+
from tesla_fleet_api.tesla.tesla import Tesla
|
55
57
|
|
56
58
|
def prependLength(message: bytes) -> bytearray:
|
57
59
|
"""Prepend a 2-byte length to the payload."""
|
@@ -76,7 +78,7 @@ class VehicleBluetooth(Commands):
|
|
76
78
|
self.ble_name = "S" + hashlib.sha1(vin.encode('utf-8')).hexdigest()[:16] + "C"
|
77
79
|
self._futures = {}
|
78
80
|
|
79
|
-
async def
|
81
|
+
async def find_client(self, scanner: BleakScanner = BleakScanner()) -> BleakClient:
|
80
82
|
"""Find the Tesla BLE device."""
|
81
83
|
|
82
84
|
device = await scanner.find_device_by_name(self.ble_name)
|
@@ -87,8 +89,8 @@ class VehicleBluetooth(Commands):
|
|
87
89
|
LOGGER.debug(f"Discovered device {self._device.name} {self._device.address}")
|
88
90
|
return self.client
|
89
91
|
|
90
|
-
def create_client(self, mac:str):
|
91
|
-
"""Create a client
|
92
|
+
def create_client(self, mac:str) -> BleakClient:
|
93
|
+
"""Create a client using a MAC address."""
|
92
94
|
self.client = BleakClient(mac, services=[SERVICE_UUID])
|
93
95
|
return self.client
|
94
96
|
|
@@ -108,11 +110,11 @@ class VehicleBluetooth(Commands):
|
|
108
110
|
await self.connect()
|
109
111
|
return self
|
110
112
|
|
111
|
-
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
113
|
+
async def __aexit__(self, exc_type, exc_val, exc_tb) -> None:
|
112
114
|
"""Exit the async context."""
|
113
115
|
await self.disconnect()
|
114
116
|
|
115
|
-
def _on_notify(self,sender: BleakGATTCharacteristic,data : bytearray):
|
117
|
+
def _on_notify(self,sender: BleakGATTCharacteristic,data : bytearray) -> None:
|
116
118
|
"""Receive data from the Tesla BLE device."""
|
117
119
|
if self._recv_len:
|
118
120
|
self._recv += data
|
@@ -131,7 +133,7 @@ class VehicleBluetooth(Commands):
|
|
131
133
|
self._recv = bytearray()
|
132
134
|
self._recv_len = 0
|
133
135
|
|
134
|
-
def _on_message(self, data:bytes):
|
136
|
+
def _on_message(self, data:bytes) -> None:
|
135
137
|
"""Receive messages from the Tesla BLE data."""
|
136
138
|
try:
|
137
139
|
msg = RoutableMessage.FromString(data)
|
@@ -149,18 +151,18 @@ class VehicleBluetooth(Commands):
|
|
149
151
|
# Get the ephemeral key here and save to self._ekey
|
150
152
|
return
|
151
153
|
|
152
|
-
if msg.from_destination.domain == Domain.DOMAIN_VEHICLE_SECURITY:
|
153
|
-
submsg = FromVCSECMessage.FromString(msg.protobuf_message_as_bytes)
|
154
|
-
print(submsg)
|
155
|
-
elif msg.from_destination.domain == Domain.DOMAIN_INFOTAINMENT:
|
156
|
-
submsg = Response.FromString(msg.protobuf_message_as_bytes)
|
157
|
-
print(submsg)
|
158
|
-
|
159
154
|
if(self._futures[msg.from_destination.domain]):
|
160
155
|
LOGGER.debug(f"Received response for request {msg.request_uuid}")
|
161
156
|
self._futures[msg.from_destination.domain].set_result(msg)
|
162
157
|
return
|
163
158
|
|
159
|
+
if msg.from_destination.domain == Domain.DOMAIN_VEHICLE_SECURITY:
|
160
|
+
submsg = FromVCSECMessage.FromString(msg.protobuf_message_as_bytes)
|
161
|
+
LOGGER.warning(f"Received orphaned VCSEC response: {submsg}")
|
162
|
+
elif msg.from_destination.domain == Domain.DOMAIN_INFOTAINMENT:
|
163
|
+
submsg = Response.FromString(msg.protobuf_message_as_bytes)
|
164
|
+
LOGGER.warning(f"Received orphaned INFOTAINMENT response: {submsg}")
|
165
|
+
|
164
166
|
async def _create_future(self, domain: Domain) -> Future:
|
165
167
|
if(not self._sessions[domain].lock.locked):
|
166
168
|
raise ValueError("Session is not locked")
|
@@ -210,10 +212,15 @@ class VehicleBluetooth(Commands):
|
|
210
212
|
)
|
211
213
|
resp = await self._send(msg)
|
212
214
|
respMsg = FromVCSECMessage.FromString(resp.protobuf_message_as_bytes)
|
213
|
-
print(respMsg)
|
214
215
|
if(respMsg.commandStatus.whitelistOperationStatus.whitelistOperationInformation):
|
215
216
|
if(respMsg.commandStatus.whitelistOperationStatus.whitelistOperationInformation < len(WHITELIST_OPERATION_STATUS)):
|
216
217
|
raise WHITELIST_OPERATION_STATUS[respMsg.commandStatus.whitelistOperationStatus.whitelistOperationInformation]
|
217
218
|
else:
|
218
|
-
raise
|
219
|
+
raise WhitelistOperationStatus(f"Unknown whitelist operation failure: {respMsg.commandStatus.whitelistOperationStatus.whitelistOperationInformation}")
|
219
220
|
return
|
221
|
+
|
222
|
+
async def wake_up(self):
|
223
|
+
"""Wake up the vehicle."""
|
224
|
+
return await self._sendVehicleSecurity(
|
225
|
+
UnsignedMessage(RKEAction=RKEAction_E.RKE_ACTION_WAKE_VEHICLE)
|
226
|
+
)
|
@@ -13,16 +13,16 @@ from cryptography.hazmat.primitives.hashes import Hash, SHA256
|
|
13
13
|
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
|
14
14
|
from asyncio import Lock, sleep
|
15
15
|
|
16
|
-
from
|
16
|
+
from tesla_fleet_api.exceptions import (
|
17
17
|
SIGNED_MESSAGE_INFORMATION_FAULTS,
|
18
18
|
TeslaFleetMessageFaultIncorrectEpoch,
|
19
19
|
TeslaFleetMessageFaultInvalidTokenOrCounter,
|
20
20
|
)
|
21
21
|
|
22
|
-
from .vehicle import Vehicle
|
22
|
+
from tesla_fleet_api.tesla.vehicle.vehicle import Vehicle
|
23
23
|
|
24
24
|
|
25
|
-
from
|
25
|
+
from tesla_fleet_api.const import (
|
26
26
|
LOGGER,
|
27
27
|
Trunk,
|
28
28
|
ClimateKeeperMode,
|
@@ -32,11 +32,11 @@ from ...const import (
|
|
32
32
|
)
|
33
33
|
|
34
34
|
# Protocol
|
35
|
-
from .proto.errors_pb2 import GenericError_E
|
36
|
-
from .proto.car_server_pb2 import (
|
35
|
+
from tesla_fleet_api.tesla.vehicle.proto.errors_pb2 import GenericError_E
|
36
|
+
from tesla_fleet_api.tesla.vehicle.proto.car_server_pb2 import (
|
37
37
|
Response,
|
38
38
|
)
|
39
|
-
from .proto.signatures_pb2 import (
|
39
|
+
from tesla_fleet_api.tesla.vehicle.proto.signatures_pb2 import (
|
40
40
|
SIGNATURE_TYPE_AES_GCM_PERSONALIZED,
|
41
41
|
SIGNATURE_TYPE_HMAC_PERSONALIZED,
|
42
42
|
TAG_COUNTER,
|
@@ -51,7 +51,7 @@ from .proto.signatures_pb2 import (
|
|
51
51
|
SessionInfo,
|
52
52
|
SignatureData,
|
53
53
|
)
|
54
|
-
from .proto.universal_message_pb2 import (
|
54
|
+
from tesla_fleet_api.tesla.vehicle.proto.universal_message_pb2 import (
|
55
55
|
DOMAIN_INFOTAINMENT,
|
56
56
|
DOMAIN_VEHICLE_SECURITY,
|
57
57
|
OPERATIONSTATUS_ERROR,
|
@@ -61,11 +61,11 @@ from .proto.universal_message_pb2 import (
|
|
61
61
|
RoutableMessage,
|
62
62
|
SessionInfoRequest,
|
63
63
|
)
|
64
|
-
from .proto.vcsec_pb2 import (
|
64
|
+
from tesla_fleet_api.tesla.vehicle.proto.vcsec_pb2 import (
|
65
65
|
OPERATIONSTATUS_OK,
|
66
66
|
FromVCSECMessage,
|
67
67
|
)
|
68
|
-
from .proto.car_server_pb2 import (
|
68
|
+
from tesla_fleet_api.tesla.vehicle.proto.car_server_pb2 import (
|
69
69
|
Action,
|
70
70
|
MediaPlayAction,
|
71
71
|
VehicleAction,
|
@@ -83,8 +83,6 @@ from .proto.car_server_pb2 import (
|
|
83
83
|
HvacSteeringWheelHeaterAction,
|
84
84
|
HvacTemperatureAdjustmentAction,
|
85
85
|
GetNearbyChargingSites,
|
86
|
-
# NearbyChargingSites,
|
87
|
-
# Superchargers,
|
88
86
|
VehicleControlCancelSoftwareUpdateAction,
|
89
87
|
VehicleControlHonkHornAction,
|
90
88
|
VehicleControlResetValetPinAction,
|
@@ -112,24 +110,24 @@ from .proto.car_server_pb2 import (
|
|
112
110
|
MediaPreviousTrack,
|
113
111
|
MediaPreviousFavorite,
|
114
112
|
)
|
115
|
-
from .proto.vehicle_pb2 import VehicleState, ClimateState
|
116
|
-
from .proto.vcsec_pb2 import (
|
113
|
+
from tesla_fleet_api.tesla.vehicle.proto.vehicle_pb2 import VehicleState, ClimateState
|
114
|
+
from tesla_fleet_api.tesla.vehicle.proto.vcsec_pb2 import (
|
117
115
|
UnsignedMessage,
|
118
116
|
RKEAction_E,
|
119
117
|
ClosureMoveRequest,
|
120
118
|
ClosureMoveType_E,
|
121
119
|
)
|
122
|
-
from .proto.signatures_pb2 import (
|
120
|
+
from tesla_fleet_api.tesla.vehicle.proto.signatures_pb2 import (
|
123
121
|
HMAC_Personalized_Signature_Data,
|
124
122
|
)
|
125
|
-
from .proto.common_pb2 import (
|
123
|
+
from tesla_fleet_api.tesla.vehicle.proto.common_pb2 import (
|
126
124
|
Void,
|
127
125
|
PreconditioningTimes,
|
128
126
|
OffPeakChargingTimes,
|
129
127
|
)
|
130
128
|
|
131
129
|
if TYPE_CHECKING:
|
132
|
-
from
|
130
|
+
from tesla_fleet_api.tesla.tesla import Tesla
|
133
131
|
|
134
132
|
# ENUMs to convert ints to proto typed ints
|
135
133
|
AutoSeatClimatePositions = (
|
@@ -4,7 +4,7 @@ from locale import getlocale
|
|
4
4
|
from time import time
|
5
5
|
from typing import TYPE_CHECKING, Any, List
|
6
6
|
|
7
|
-
from
|
7
|
+
from tesla_fleet_api.const import (
|
8
8
|
CabinOverheatProtectionTemp,
|
9
9
|
ClimateKeeperMode,
|
10
10
|
Level,
|
@@ -15,12 +15,12 @@ from ...const import (
|
|
15
15
|
VehicleDataEndpoint,
|
16
16
|
WindowCommand,
|
17
17
|
)
|
18
|
-
from .vehicle import Vehicle
|
18
|
+
from tesla_fleet_api.tesla.vehicle.vehicle import Vehicle
|
19
19
|
|
20
20
|
DEFAULT_LOCALE = (getlocale()[0] or "en-US").replace("_","-")
|
21
21
|
|
22
22
|
if TYPE_CHECKING:
|
23
|
-
from
|
23
|
+
from tesla_fleet_api.tesla.fleet import TeslaFleetApi
|
24
24
|
|
25
25
|
class VehicleFleet(Vehicle):
|
26
26
|
"""Class describing the Tesla Fleet API vehicle endpoints and commands."""
|
@@ -3,21 +3,20 @@ from __future__ import annotations
|
|
3
3
|
import base64
|
4
4
|
from typing import TYPE_CHECKING
|
5
5
|
|
6
|
-
from .fleet import VehicleFleet
|
7
|
-
from .commands import Commands
|
8
|
-
|
9
|
-
from ...exceptions import (
|
6
|
+
from tesla_fleet_api.tesla.vehicle.fleet import VehicleFleet
|
7
|
+
from tesla_fleet_api.tesla.vehicle.commands import Commands
|
8
|
+
from tesla_fleet_api.exceptions import (
|
10
9
|
MESSAGE_FAULTS,
|
11
10
|
)
|
12
|
-
from .proto.signatures_pb2 import (
|
11
|
+
from tesla_fleet_api.tesla.vehicle.proto.signatures_pb2 import (
|
13
12
|
SessionInfo,
|
14
13
|
)
|
15
|
-
from .proto.universal_message_pb2 import (
|
14
|
+
from tesla_fleet_api.tesla.vehicle.proto.universal_message_pb2 import (
|
16
15
|
RoutableMessage,
|
17
16
|
)
|
18
17
|
|
19
18
|
if TYPE_CHECKING:
|
20
|
-
from
|
19
|
+
from tesla_fleet_api.tesla.fleet import TeslaFleetApi
|
21
20
|
|
22
21
|
|
23
22
|
class VehicleSigned(VehicleFleet, Commands):
|
@@ -1,13 +1,13 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
from typing import TYPE_CHECKING
|
3
3
|
|
4
|
-
from .signed import VehicleSigned
|
5
|
-
from .bluetooth import VehicleBluetooth
|
6
|
-
from .fleet import VehicleFleet
|
7
|
-
from .vehicle import Vehicle
|
4
|
+
from tesla_fleet_api.tesla.vehicle.signed import VehicleSigned
|
5
|
+
from tesla_fleet_api.tesla.vehicle.bluetooth import VehicleBluetooth
|
6
|
+
from tesla_fleet_api.tesla.vehicle.fleet import VehicleFleet
|
7
|
+
from tesla_fleet_api.tesla.vehicle.vehicle import Vehicle
|
8
8
|
|
9
9
|
if TYPE_CHECKING:
|
10
|
-
from
|
10
|
+
from tesla_fleet_api.tesla.fleet import TeslaFleetApi
|
11
11
|
|
12
12
|
|
13
13
|
|
@@ -2,12 +2,12 @@ from typing import Any
|
|
2
2
|
|
3
3
|
import aiohttp
|
4
4
|
|
5
|
-
from
|
6
|
-
from
|
7
|
-
from
|
8
|
-
from .vehicle import TeslemetryVehicles
|
9
|
-
from
|
10
|
-
from
|
5
|
+
from tesla_fleet_api.tesla.charging import Charging
|
6
|
+
from tesla_fleet_api.tesla.energysite import EnergySites
|
7
|
+
from tesla_fleet_api.tesla.user import User
|
8
|
+
from tesla_fleet_api.teslemetry.vehicle import TeslemetryVehicles
|
9
|
+
from tesla_fleet_api.const import LOGGER, Method
|
10
|
+
from tesla_fleet_api.tesla import TeslaFleetApi
|
11
11
|
|
12
12
|
class Teslemetry(TeslaFleetApi):
|
13
13
|
|
@@ -1,15 +1,13 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
from typing import TYPE_CHECKING, Any
|
3
3
|
|
4
|
-
from
|
5
|
-
from
|
6
|
-
from
|
7
|
-
from
|
8
|
-
from ..tesla.vehicle.bluetooth import VehicleBluetooth
|
9
|
-
from ..tesla.vehicle.fleet import VehicleFleet
|
4
|
+
from tesla_fleet_api.const import Method
|
5
|
+
from tesla_fleet_api.tesla.vehicle.vehicle import Vehicle
|
6
|
+
from tesla_fleet_api.tesla.vehicle.vehicles import Vehicles
|
7
|
+
from tesla_fleet_api.tesla.vehicle.fleet import VehicleFleet
|
10
8
|
|
11
9
|
if TYPE_CHECKING:
|
12
|
-
|
10
|
+
pass
|
13
11
|
|
14
12
|
class TeslemetryVehicle(Vehicle):
|
15
13
|
"""Teslemetry specific base vehicle."""
|
tesla_fleet_api/tessie/tessie.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
import aiohttp
|
2
2
|
from typing import Any
|
3
3
|
|
4
|
-
from
|
5
|
-
from
|
6
|
-
from
|
7
|
-
from
|
8
|
-
from
|
9
|
-
from .vehicle import TessieVehicles
|
4
|
+
from tesla_fleet_api.tesla.charging import Charging
|
5
|
+
from tesla_fleet_api.tesla.energysite import EnergySites
|
6
|
+
from tesla_fleet_api.tesla.user import User
|
7
|
+
from tesla_fleet_api.tesla import TeslaFleetApi
|
8
|
+
from tesla_fleet_api.const import Method
|
9
|
+
from tesla_fleet_api.tessie.vehicle import TessieVehicles
|
10
10
|
|
11
11
|
class Tessie(TeslaFleetApi):
|
12
12
|
|
@@ -1,15 +1,9 @@
|
|
1
1
|
from __future__ import annotations
|
2
|
-
from typing import TYPE_CHECKING, Any
|
3
2
|
|
4
|
-
from
|
5
|
-
from
|
6
|
-
from
|
7
|
-
from ..tesla.vehicle.vehicles import Vehicles
|
8
|
-
from ..tesla.vehicle.bluetooth import VehicleBluetooth
|
9
|
-
from ..tesla.vehicle.fleet import VehicleFleet
|
3
|
+
from tesla_fleet_api.tesla.vehicle.vehicle import Vehicle
|
4
|
+
from tesla_fleet_api.tesla.vehicle.vehicles import Vehicles
|
5
|
+
from tesla_fleet_api.tesla.vehicle.fleet import VehicleFleet
|
10
6
|
|
11
|
-
if TYPE_CHECKING:
|
12
|
-
from .tessie import Tessie
|
13
7
|
|
14
8
|
class TessieVehicle(Vehicle):
|
15
9
|
"""Tessie specific base vehicle."""
|
@@ -1,23 +1,23 @@
|
|
1
|
-
tesla_fleet_api/__init__.py,sha256=
|
2
|
-
tesla_fleet_api/const.py,sha256=
|
3
|
-
tesla_fleet_api/exceptions.py,sha256=
|
1
|
+
tesla_fleet_api/__init__.py,sha256=3DZMoZ-5srW-7SooAjqcRubQDuZPY8rMKH7eqIp4qtg,392
|
2
|
+
tesla_fleet_api/const.py,sha256=GZFCZXq6-dRlECb7auojMGg0y03zg-Dt_zfeQ6aT8oY,3158
|
3
|
+
tesla_fleet_api/exceptions.py,sha256=c-Was9VCfyiVG3H5XwygTBVXJ4Ib8H1WoPe3srXWRTk,34633
|
4
4
|
tesla_fleet_api/ratecalculator.py,sha256=4lz8yruUeouHXh_3ezsXX-CTpIegp1T1J4VuRV_qdHA,1791
|
5
|
-
tesla_fleet_api/tesla/__init__.py,sha256=
|
6
|
-
tesla_fleet_api/tesla/bluetooth.py,sha256=
|
7
|
-
tesla_fleet_api/tesla/charging.py,sha256=
|
8
|
-
tesla_fleet_api/tesla/energysite.py,sha256=
|
9
|
-
tesla_fleet_api/tesla/fleet.py,sha256=
|
10
|
-
tesla_fleet_api/tesla/oauth.py,sha256=
|
5
|
+
tesla_fleet_api/tesla/__init__.py,sha256=Cvpqu8OaOFmbuwu9KjgYrje8eVluDp2IU_zwdtXbmO0,282
|
6
|
+
tesla_fleet_api/tesla/bluetooth.py,sha256=l2HOew_iCOw5RRr190NQasz080NYiea47fgjQIh_kGs,1271
|
7
|
+
tesla_fleet_api/tesla/charging.py,sha256=D7I7cAf-3-95sIjyP6wpVqCq9Cppj6U-VPFQGpQQ8bs,1704
|
8
|
+
tesla_fleet_api/tesla/energysite.py,sha256=96Q5npsJ2YIa257o_NL5_3gJNUS-ioAL7sTeQeGPgAM,6110
|
9
|
+
tesla_fleet_api/tesla/fleet.py,sha256=X74tzwGO9w65j9YUGuW04CwG7Bx6biEHwxIjWGCzB4c,5670
|
10
|
+
tesla_fleet_api/tesla/oauth.py,sha256=aWBsWmnM-QxzaU8W9TXVNxGsYn_LraXnpexwdE8wOqo,4104
|
11
11
|
tesla_fleet_api/tesla/partner.py,sha256=TU3Xg18x2w3PHv6Dy3Mo40pb417pp5lqnF0c1vDCt6g,1224
|
12
12
|
tesla_fleet_api/tesla/tesla.py,sha256=Jlz90-fM0nJbhnQN0k3ukNv59-9KqZZbyQ91IiLIbfo,2010
|
13
|
-
tesla_fleet_api/tesla/user.py,sha256=
|
14
|
-
tesla_fleet_api/tesla/vehicle/__init__.py,sha256=
|
15
|
-
tesla_fleet_api/tesla/vehicle/bluetooth.py,sha256=
|
16
|
-
tesla_fleet_api/tesla/vehicle/commands.py,sha256=
|
17
|
-
tesla_fleet_api/tesla/vehicle/fleet.py,sha256=
|
18
|
-
tesla_fleet_api/tesla/vehicle/signed.py,sha256=
|
19
|
-
tesla_fleet_api/tesla/vehicle/vehicle.py,sha256=
|
20
|
-
tesla_fleet_api/tesla/vehicle/vehicles.py,sha256=
|
13
|
+
tesla_fleet_api/tesla/user.py,sha256=w8rwiAOIFjuDus8M0RpZ0wucJtw8kYFKtJfYVk7Ekr0,1194
|
14
|
+
tesla_fleet_api/tesla/vehicle/__init__.py,sha256=3A5_wTQHofRShof4pUNOtF78-7lUh62uz2jq2ecnmRY,381
|
15
|
+
tesla_fleet_api/tesla/vehicle/bluetooth.py,sha256=BQ5r7Fpogs8_zL9EBAq3XW--AbuDh1eUmTYm-wJok0M,8735
|
16
|
+
tesla_fleet_api/tesla/vehicle/commands.py,sha256=RBK_tQmrtjIAUjTCmGyRE5x0U1UeFJRHVmlG2y9u2PA,47191
|
17
|
+
tesla_fleet_api/tesla/vehicle/fleet.py,sha256=K9BVZj6CChJSDSMFroa7Cz0KrsYWj32ILtQumarkLaU,32080
|
18
|
+
tesla_fleet_api/tesla/vehicle/signed.py,sha256=OPQy_LHxTvRcY8bAHrzRLPlN_vYOupdr_TEmHY9PGuQ,1807
|
19
|
+
tesla_fleet_api/tesla/vehicle/vehicle.py,sha256=TyW5-LRlgRulWsm2indE3utSTdrJJRfG7H45Cc-ZASk,505
|
20
|
+
tesla_fleet_api/tesla/vehicle/vehicles.py,sha256=kQWOlvpseDqs2c8Co3Elo4RPeoHbK7AeSyX-t4Q5MDM,1585
|
21
21
|
tesla_fleet_api/tesla/vehicle/proto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
22
|
tesla_fleet_api/tesla/vehicle/proto/__init__.pyi,sha256=qFXWNIgl71wB260u-XPzaAwWAHL6krw21q-aXnBtop0,252
|
23
23
|
tesla_fleet_api/tesla/vehicle/proto/car_server_pb2.py,sha256=v_eb4NDIkx_ZYPYW29_EFRky5vQ4b2q14gwuQSbouYw,29202
|
@@ -38,14 +38,14 @@ tesla_fleet_api/tesla/vehicle/proto/vcsec_pb2.py,sha256=PDv9TfiXnNs6sQ0D5vBrsSSP
|
|
38
38
|
tesla_fleet_api/tesla/vehicle/proto/vcsec_pb2.pyi,sha256=cyK1uyRtDjRVqVlyl5uRQYY1RhFlWSJheLg3PGfs-_s,28524
|
39
39
|
tesla_fleet_api/tesla/vehicle/proto/vehicle_pb2.py,sha256=bqyFJM-1qZ7W9XKREINhYZx8yXAudmq6W8_Pdfkhbkk,44711
|
40
40
|
tesla_fleet_api/tesla/vehicle/proto/vehicle_pb2.pyi,sha256=sAUW_9aVB8NqJCnhZjXMLfqfePLVZv_7PfSKZKEBaQA,74251
|
41
|
-
tesla_fleet_api/teslemetry/__init__.py,sha256=
|
42
|
-
tesla_fleet_api/teslemetry/teslemetry.py,sha256=
|
43
|
-
tesla_fleet_api/teslemetry/vehicle.py,sha256=
|
44
|
-
tesla_fleet_api/tessie/__init__.py,sha256=
|
45
|
-
tesla_fleet_api/tessie/tessie.py,sha256=
|
46
|
-
tesla_fleet_api/tessie/vehicle.py,sha256=
|
47
|
-
tesla_fleet_api-1.0.
|
48
|
-
tesla_fleet_api-1.0.
|
49
|
-
tesla_fleet_api-1.0.
|
50
|
-
tesla_fleet_api-1.0.
|
51
|
-
tesla_fleet_api-1.0.
|
41
|
+
tesla_fleet_api/teslemetry/__init__.py,sha256=CX7rMtlTuVvXoH9GkOAkQBTtM13ltuOO6EsGELuzQzY,94
|
42
|
+
tesla_fleet_api/teslemetry/teslemetry.py,sha256=OjbKHOtz42SvLzGK9hcaoWyGGee2mHeE-h6oFSbJPX8,3086
|
43
|
+
tesla_fleet_api/teslemetry/vehicle.py,sha256=9_2N1iNNDouqfb6YBBWAFjnlzVRTf5frhXiuWRT8C7g,2185
|
44
|
+
tesla_fleet_api/tessie/__init__.py,sha256=9lhQJaB6X4PObUL9QdaaZYqs2BxiTidu3zmHcBESLVw,78
|
45
|
+
tesla_fleet_api/tessie/tessie.py,sha256=qdMZ61TcQi5JRuv2qaxuLHtOuy8WZJ1WNqWg5WDAwwU,2615
|
46
|
+
tesla_fleet_api/tessie/vehicle.py,sha256=9khv4oCkGGLxHzQ2FYhDPH7wczxEDiUppsDXalawarE,1125
|
47
|
+
tesla_fleet_api-1.0.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
48
|
+
tesla_fleet_api-1.0.2.dist-info/METADATA,sha256=vxPX8yS0x5TVB11oyZeKQQV3NIVd3ZRF_nYSGIDgEhk,4056
|
49
|
+
tesla_fleet_api-1.0.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
50
|
+
tesla_fleet_api-1.0.2.dist-info/top_level.txt,sha256=jeNbog_1saXBFrGpom9WyPWmilxsyP3szL_G7JLWQfM,16
|
51
|
+
tesla_fleet_api-1.0.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|