tesla-fleet-api 1.0.11__tar.gz → 1.0.13__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 (63) hide show
  1. tesla_fleet_api-1.0.13/PKG-INFO +254 -0
  2. tesla_fleet_api-1.0.13/README.md +223 -0
  3. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/setup.py +1 -1
  4. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/const.py +11 -3
  5. tesla_fleet_api-1.0.13/tesla_fleet_api/tesla/__init__.py +25 -0
  6. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/fleet.py +1 -2
  7. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/__init__.py +2 -1
  8. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/bluetooth.py +90 -43
  9. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/commands.py +0 -1
  10. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/vehicles.py +1 -5
  11. tesla_fleet_api-1.0.13/tesla_fleet_api/teslemetry/__init__.py +14 -0
  12. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/teslemetry/vehicles.py +10 -15
  13. tesla_fleet_api-1.0.13/tesla_fleet_api/tessie/__init__.py +14 -0
  14. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tessie/vehicles.py +10 -15
  15. tesla_fleet_api-1.0.13/tesla_fleet_api.egg-info/PKG-INFO +254 -0
  16. tesla_fleet_api-1.0.11/PKG-INFO +0 -158
  17. tesla_fleet_api-1.0.11/README.md +0 -127
  18. tesla_fleet_api-1.0.11/tesla_fleet_api/tesla/__init__.py +0 -11
  19. tesla_fleet_api-1.0.11/tesla_fleet_api/teslemetry/__init__.py +0 -5
  20. tesla_fleet_api-1.0.11/tesla_fleet_api/tessie/__init__.py +0 -5
  21. tesla_fleet_api-1.0.11/tesla_fleet_api.egg-info/PKG-INFO +0 -158
  22. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/LICENSE +0 -0
  23. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/pyproject.toml +0 -0
  24. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/setup.cfg +0 -0
  25. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/__init__.py +0 -0
  26. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/exceptions.py +0 -0
  27. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/ratecalculator.py +0 -0
  28. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/bluetooth.py +0 -0
  29. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/charging.py +0 -0
  30. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/energysite.py +0 -0
  31. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/oauth.py +0 -0
  32. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/partner.py +0 -0
  33. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/tesla.py +0 -0
  34. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/user.py +0 -0
  35. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/fleet.py +0 -0
  36. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/__init__.py +0 -0
  37. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/__init__.pyi +0 -0
  38. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/car_server_pb2.py +0 -0
  39. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/car_server_pb2.pyi +0 -0
  40. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/common_pb2.py +0 -0
  41. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/common_pb2.pyi +0 -0
  42. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/errors_pb2.py +0 -0
  43. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/errors_pb2.pyi +0 -0
  44. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/keys_pb2.py +0 -0
  45. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/keys_pb2.pyi +0 -0
  46. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/managed_charging_pb2.py +0 -0
  47. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/managed_charging_pb2.pyi +0 -0
  48. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/signatures_pb2.py +0 -0
  49. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/signatures_pb2.pyi +0 -0
  50. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/universal_message_pb2.py +0 -0
  51. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/universal_message_pb2.pyi +0 -0
  52. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/vcsec_pb2.py +0 -0
  53. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/vcsec_pb2.pyi +0 -0
  54. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/vehicle_pb2.py +0 -0
  55. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/proto/vehicle_pb2.pyi +0 -0
  56. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/signed.py +0 -0
  57. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tesla/vehicle/vehicle.py +0 -0
  58. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/teslemetry/teslemetry.py +0 -0
  59. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api/tessie/tessie.py +0 -0
  60. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api.egg-info/SOURCES.txt +0 -0
  61. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api.egg-info/dependency_links.txt +0 -0
  62. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api.egg-info/requires.txt +0 -0
  63. {tesla_fleet_api-1.0.11 → tesla_fleet_api-1.0.13}/tesla_fleet_api.egg-info/top_level.txt +0 -0
@@ -0,0 +1,254 @@
1
+ Metadata-Version: 2.2
2
+ Name: tesla_fleet_api
3
+ Version: 1.0.13
4
+ Summary: Tesla Fleet API library for Python
5
+ Home-page: https://github.com/Teslemetry/python-tesla-fleet-api
6
+ Author: Brett Adams
7
+ Author-email: hello@teslemetry.com
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: Apache Software License
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: aiohttp
16
+ Requires-Dist: aiofiles
17
+ Requires-Dist: aiolimiter
18
+ Requires-Dist: cryptography
19
+ Requires-Dist: protobuf
20
+ Requires-Dist: bleak
21
+ Requires-Dist: bleak-retry-connector
22
+ Dynamic: author
23
+ Dynamic: author-email
24
+ Dynamic: classifier
25
+ Dynamic: description
26
+ Dynamic: description-content-type
27
+ Dynamic: home-page
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
31
+
32
+ # Tesla Fleet API
33
+
34
+ Tesla Fleet API is a Python library that provides an interface to interact with Tesla's Fleet API, including signed commands and encrypted local Bluetooth (BLE) communication. It also supports interactions with Teslemetry and Tessie services.
35
+
36
+ ## Features
37
+
38
+ - Fleet API for vehicles
39
+ - Fleet API for energy sites
40
+ - Fleet API with signed vehicle commands
41
+ - Bluetooth for vehicles
42
+ - Teslemetry integration
43
+ - Tessie integration
44
+
45
+ ## Installation
46
+
47
+ You can install the library using pip:
48
+
49
+ ```bash
50
+ pip install tesla-fleet-api
51
+ ```
52
+
53
+ ## Usage
54
+
55
+ ### Authentication
56
+
57
+ The `TeslaFleetOAuth` class provides methods that help with authenticating to the Tesla Fleet API. Here's a basic example:
58
+
59
+ ```python
60
+ import asyncio
61
+ import aiohttp
62
+ from tesla_fleet_api import TeslaFleetOAuth
63
+
64
+ async def main():
65
+ async with aiohttp.ClientSession() as session:
66
+ oauth = TeslaFleetOAuth(
67
+ session=session,
68
+ client_id="<client_id>",
69
+ client_secret="<client_secret>",
70
+ redirect_uri="<redirect_uri>",
71
+ )
72
+
73
+ # Get the login URL and navigate the user to it
74
+ login_url = oauth.get_login_url(scopes=["openid", "email", "offline_access"])
75
+ print(f"Please go to {login_url} and authorize access.")
76
+
77
+ # After the user authorizes access, they will be redirected to the redirect_uri with a code
78
+ code = input("Enter the code you received: ")
79
+
80
+ # Exchange the code for a refresh token
81
+ await oauth.get_refresh_token(code)
82
+ print(f"Access token: {oauth.access_token}")
83
+ print(f"Refresh token: {oauth.refresh_token}")
84
+ # Dont forget to store the refresh token so you can use it again later
85
+
86
+ asyncio.run(main())
87
+ ```
88
+
89
+ ### Fleet API for Vehicles
90
+
91
+ The `TeslaFleetApi` class provides methods to interact with the Fleet API for vehicles. Here's a basic example:
92
+
93
+ ```python
94
+ import asyncio
95
+ import aiohttp
96
+ from tesla_fleet_api import TeslaFleetApi
97
+ from tesla_fleet_api.exceptions import TeslaFleetError
98
+
99
+ async def main():
100
+ async with aiohttp.ClientSession() as session:
101
+ api = TeslaFleetApi(
102
+ access_token="<access_token>",
103
+ session=session,
104
+ region="na",
105
+ )
106
+
107
+ try:
108
+ data = await api.vehicles.list()
109
+ print(data)
110
+ except TeslaFleetError as e:
111
+ print(e)
112
+
113
+ asyncio.run(main())
114
+ ```
115
+
116
+ For more detailed examples, see [Fleet API for Vehicles](docs/fleet_api_vehicles.md).
117
+
118
+ ### Fleet API for Energy Sites
119
+
120
+ The `EnergySites` class provides methods to interact with the Fleet API for energy sites. Here's a basic example:
121
+
122
+ ```python
123
+ import asyncio
124
+ import aiohttp
125
+ from tesla_fleet_api import TeslaFleetApi
126
+ from tesla_fleet_api.exceptions import TeslaFleetError
127
+
128
+ async def main():
129
+ async with aiohttp.ClientSession() as session:
130
+ api = TeslaFleetApi(
131
+ access_token="<access_token>",
132
+ session=session,
133
+ region="na",
134
+ )
135
+
136
+ try:
137
+ energy_sites = await api.energySites.list()
138
+ print(energy_sites)
139
+ except TeslaFleetError as e:
140
+ print(e)
141
+
142
+ asyncio.run(main())
143
+ ```
144
+
145
+ For more detailed examples, see [Fleet API for Energy Sites](docs/fleet_api_energy_sites.md).
146
+
147
+ ### Fleet API with Signed Vehicle Commands
148
+
149
+ The `VehicleSigned` class provides methods to interact with the Fleet API using signed vehicle commands. Here's a basic example:
150
+
151
+ ```python
152
+ import asyncio
153
+ import aiohttp
154
+ from tesla_fleet_api import TeslaFleetApi
155
+ from tesla_fleet_api.tesla.vehicle.signed import VehicleSigned
156
+ from tesla_fleet_api.exceptions import TeslaFleetError
157
+
158
+ async def main():
159
+ async with aiohttp.ClientSession() as session:
160
+ api = TeslaFleetApi(
161
+ access_token="<access_token>",
162
+ session=session,
163
+ region="na",
164
+ )
165
+
166
+ try:
167
+ vehicle = VehicleSigned(api, "<vin>")
168
+ await vehicle.handshake()
169
+ data = await vehicle.wake_up()
170
+ print(data)
171
+ except TeslaFleetError as e:
172
+ print(e)
173
+
174
+ asyncio.run(main())
175
+ ```
176
+
177
+ For more detailed examples, see [Fleet API with Signed Vehicle Commands](docs/fleet_api_signed_commands.md).
178
+
179
+ ### Bluetooth for Vehicles
180
+
181
+ The `TeslaBluetooth` class provides methods to interact with Tesla vehicles using Bluetooth. Here's a basic example:
182
+
183
+ ```python
184
+ import asyncio
185
+ from bleak import BleakScanner
186
+ from tesla_fleet_api import TeslaBluetooth
187
+
188
+ async def main():
189
+ scanner = BleakScanner()
190
+ devices = await scanner.discover()
191
+ for device in devices:
192
+ if TeslaBluetooth().valid_name(device.name):
193
+ print(f"Found Tesla vehicle: {device.name}")
194
+
195
+ asyncio.run(main())
196
+ ```
197
+
198
+ For more detailed examples, see [Bluetooth for Vehicles](docs/bluetooth_vehicles.md).
199
+
200
+ ### Teslemetry
201
+
202
+ The `Teslemetry` class provides methods to interact with the Teslemetry service. Here's a basic example:
203
+
204
+ ```python
205
+ import asyncio
206
+ import aiohttp
207
+ from tesla_fleet_api import Teslemetry
208
+ from tesla_fleet_api.exceptions import TeslaFleetError
209
+
210
+ async def main():
211
+ async with aiohttp.ClientSession() as session:
212
+ api = Teslemetry(
213
+ access_token="<access_token>",
214
+ session=session,
215
+ )
216
+
217
+ try:
218
+ data = await api.vehicles.list()
219
+ print(data)
220
+ except TeslaFleetError as e:
221
+ print(e)
222
+
223
+ asyncio.run(main())
224
+ ```
225
+
226
+ For more detailed examples, see [Teslemetry](docs/teslemetry.md).
227
+
228
+ ### Tessie
229
+
230
+ The `Tessie` class provides methods to interact with the Tessie service. Here's a basic example:
231
+
232
+ ```python
233
+ import asyncio
234
+ import aiohttp
235
+ from tesla_fleet_api import Tessie
236
+ from tesla_fleet_api.exceptions import TeslaFleetError
237
+
238
+ async def main():
239
+ async with aiohttp.ClientSession() as session:
240
+ api = Tessie(
241
+ access_token="<access_token>",
242
+ session=session,
243
+ )
244
+
245
+ try:
246
+ data = await api.vehicles.list()
247
+ print(data)
248
+ except TeslaFleetError as e:
249
+ print(e)
250
+
251
+ asyncio.run(main())
252
+ ```
253
+
254
+ For more detailed examples, see [Tessie](docs/tessie.md).
@@ -0,0 +1,223 @@
1
+ # Tesla Fleet API
2
+
3
+ Tesla Fleet API is a Python library that provides an interface to interact with Tesla's Fleet API, including signed commands and encrypted local Bluetooth (BLE) communication. It also supports interactions with Teslemetry and Tessie services.
4
+
5
+ ## Features
6
+
7
+ - Fleet API for vehicles
8
+ - Fleet API for energy sites
9
+ - Fleet API with signed vehicle commands
10
+ - Bluetooth for vehicles
11
+ - Teslemetry integration
12
+ - Tessie integration
13
+
14
+ ## Installation
15
+
16
+ You can install the library using pip:
17
+
18
+ ```bash
19
+ pip install tesla-fleet-api
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ ### Authentication
25
+
26
+ The `TeslaFleetOAuth` class provides methods that help with authenticating to the Tesla Fleet API. Here's a basic example:
27
+
28
+ ```python
29
+ import asyncio
30
+ import aiohttp
31
+ from tesla_fleet_api import TeslaFleetOAuth
32
+
33
+ async def main():
34
+ async with aiohttp.ClientSession() as session:
35
+ oauth = TeslaFleetOAuth(
36
+ session=session,
37
+ client_id="<client_id>",
38
+ client_secret="<client_secret>",
39
+ redirect_uri="<redirect_uri>",
40
+ )
41
+
42
+ # Get the login URL and navigate the user to it
43
+ login_url = oauth.get_login_url(scopes=["openid", "email", "offline_access"])
44
+ print(f"Please go to {login_url} and authorize access.")
45
+
46
+ # After the user authorizes access, they will be redirected to the redirect_uri with a code
47
+ code = input("Enter the code you received: ")
48
+
49
+ # Exchange the code for a refresh token
50
+ await oauth.get_refresh_token(code)
51
+ print(f"Access token: {oauth.access_token}")
52
+ print(f"Refresh token: {oauth.refresh_token}")
53
+ # Dont forget to store the refresh token so you can use it again later
54
+
55
+ asyncio.run(main())
56
+ ```
57
+
58
+ ### Fleet API for Vehicles
59
+
60
+ The `TeslaFleetApi` class provides methods to interact with the Fleet API for vehicles. Here's a basic example:
61
+
62
+ ```python
63
+ import asyncio
64
+ import aiohttp
65
+ from tesla_fleet_api import TeslaFleetApi
66
+ from tesla_fleet_api.exceptions import TeslaFleetError
67
+
68
+ async def main():
69
+ async with aiohttp.ClientSession() as session:
70
+ api = TeslaFleetApi(
71
+ access_token="<access_token>",
72
+ session=session,
73
+ region="na",
74
+ )
75
+
76
+ try:
77
+ data = await api.vehicles.list()
78
+ print(data)
79
+ except TeslaFleetError as e:
80
+ print(e)
81
+
82
+ asyncio.run(main())
83
+ ```
84
+
85
+ For more detailed examples, see [Fleet API for Vehicles](docs/fleet_api_vehicles.md).
86
+
87
+ ### Fleet API for Energy Sites
88
+
89
+ The `EnergySites` class provides methods to interact with the Fleet API for energy sites. Here's a basic example:
90
+
91
+ ```python
92
+ import asyncio
93
+ import aiohttp
94
+ from tesla_fleet_api import TeslaFleetApi
95
+ from tesla_fleet_api.exceptions import TeslaFleetError
96
+
97
+ async def main():
98
+ async with aiohttp.ClientSession() as session:
99
+ api = TeslaFleetApi(
100
+ access_token="<access_token>",
101
+ session=session,
102
+ region="na",
103
+ )
104
+
105
+ try:
106
+ energy_sites = await api.energySites.list()
107
+ print(energy_sites)
108
+ except TeslaFleetError as e:
109
+ print(e)
110
+
111
+ asyncio.run(main())
112
+ ```
113
+
114
+ For more detailed examples, see [Fleet API for Energy Sites](docs/fleet_api_energy_sites.md).
115
+
116
+ ### Fleet API with Signed Vehicle Commands
117
+
118
+ The `VehicleSigned` class provides methods to interact with the Fleet API using signed vehicle commands. Here's a basic example:
119
+
120
+ ```python
121
+ import asyncio
122
+ import aiohttp
123
+ from tesla_fleet_api import TeslaFleetApi
124
+ from tesla_fleet_api.tesla.vehicle.signed import VehicleSigned
125
+ from tesla_fleet_api.exceptions import TeslaFleetError
126
+
127
+ async def main():
128
+ async with aiohttp.ClientSession() as session:
129
+ api = TeslaFleetApi(
130
+ access_token="<access_token>",
131
+ session=session,
132
+ region="na",
133
+ )
134
+
135
+ try:
136
+ vehicle = VehicleSigned(api, "<vin>")
137
+ await vehicle.handshake()
138
+ data = await vehicle.wake_up()
139
+ print(data)
140
+ except TeslaFleetError as e:
141
+ print(e)
142
+
143
+ asyncio.run(main())
144
+ ```
145
+
146
+ For more detailed examples, see [Fleet API with Signed Vehicle Commands](docs/fleet_api_signed_commands.md).
147
+
148
+ ### Bluetooth for Vehicles
149
+
150
+ The `TeslaBluetooth` class provides methods to interact with Tesla vehicles using Bluetooth. Here's a basic example:
151
+
152
+ ```python
153
+ import asyncio
154
+ from bleak import BleakScanner
155
+ from tesla_fleet_api import TeslaBluetooth
156
+
157
+ async def main():
158
+ scanner = BleakScanner()
159
+ devices = await scanner.discover()
160
+ for device in devices:
161
+ if TeslaBluetooth().valid_name(device.name):
162
+ print(f"Found Tesla vehicle: {device.name}")
163
+
164
+ asyncio.run(main())
165
+ ```
166
+
167
+ For more detailed examples, see [Bluetooth for Vehicles](docs/bluetooth_vehicles.md).
168
+
169
+ ### Teslemetry
170
+
171
+ The `Teslemetry` class provides methods to interact with the Teslemetry service. Here's a basic example:
172
+
173
+ ```python
174
+ import asyncio
175
+ import aiohttp
176
+ from tesla_fleet_api import Teslemetry
177
+ from tesla_fleet_api.exceptions import TeslaFleetError
178
+
179
+ async def main():
180
+ async with aiohttp.ClientSession() as session:
181
+ api = Teslemetry(
182
+ access_token="<access_token>",
183
+ session=session,
184
+ )
185
+
186
+ try:
187
+ data = await api.vehicles.list()
188
+ print(data)
189
+ except TeslaFleetError as e:
190
+ print(e)
191
+
192
+ asyncio.run(main())
193
+ ```
194
+
195
+ For more detailed examples, see [Teslemetry](docs/teslemetry.md).
196
+
197
+ ### Tessie
198
+
199
+ The `Tessie` class provides methods to interact with the Tessie service. Here's a basic example:
200
+
201
+ ```python
202
+ import asyncio
203
+ import aiohttp
204
+ from tesla_fleet_api import Tessie
205
+ from tesla_fleet_api.exceptions import TeslaFleetError
206
+
207
+ async def main():
208
+ async with aiohttp.ClientSession() as session:
209
+ api = Tessie(
210
+ access_token="<access_token>",
211
+ session=session,
212
+ )
213
+
214
+ try:
215
+ data = await api.vehicles.list()
216
+ print(data)
217
+ except TeslaFleetError as e:
218
+ print(e)
219
+
220
+ asyncio.run(main())
221
+ ```
222
+
223
+ For more detailed examples, see [Tessie](docs/tessie.md).
@@ -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="1.0.11",
8
+ version="1.0.13",
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 = "1.0.11"
6
+ VERSION = "1.0.13"
7
7
  LOGGER = logging.getLogger(__package__)
8
8
  SERVERS = {
9
9
  "na": "https://fleet-api.prd.na.vn.cloud.tesla.com",
@@ -47,10 +47,18 @@ class Seat(IntEnum):
47
47
  FRONT_LEFT = 0
48
48
  FRONT_RIGHT = 1
49
49
  REAR_LEFT = 2
50
+ REAT_LEFT_BACK = 3
50
51
  REAR_CENTER = 4
51
52
  REAR_RIGHT = 5
52
- THIRD_LEFT = 6
53
- THIRD_RIGHT = 7
53
+ REAR_RIGHT_BACK = 6
54
+ THIRD_LEFT = 7
55
+ THIRD_RIGHT = 8
56
+
57
+ class AutoSeat(IntEnum):
58
+ """Auto Climate Seat positions"""
59
+
60
+ FRONT_LEFT = 1
61
+ FRONT_RIGHT = 2
54
62
 
55
63
 
56
64
  class Level(IntEnum):
@@ -0,0 +1,25 @@
1
+ """Tesla Fleet API classes."""
2
+
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
+ from tesla_fleet_api.tesla.charging import Charging
7
+ from tesla_fleet_api.tesla.energysite import EnergySites
8
+ from tesla_fleet_api.tesla.partner import Partner
9
+ from tesla_fleet_api.tesla.user import User
10
+ from tesla_fleet_api.tesla.vehicle import Vehicles, VehiclesBluetooth, VehicleFleet, VehicleSigned, VehicleBluetooth
11
+
12
+ __all__ = [
13
+ "TeslaFleetApi",
14
+ "TeslaBluetooth",
15
+ "TeslaFleetOAuth",
16
+ "Charging",
17
+ "EnergySites",
18
+ "Partner",
19
+ "User",
20
+ "Vehicles",
21
+ "VehiclesBluetooth",
22
+ "VehicleFleet",
23
+ "VehicleSigned",
24
+ "VehicleBluetooth"
25
+ ]
@@ -115,8 +115,7 @@ class TeslaFleetApi(Tesla):
115
115
  json=json,
116
116
  params=params,
117
117
  ) as resp:
118
- LOGGER.debug("Requested: %s", resp.url)
119
- LOGGER.debug("Response Status: %s", resp.status)
118
+ LOGGER.debug("Status %s from %s", resp.status, resp.url)
120
119
  if "x-txid" in resp.headers:
121
120
  LOGGER.debug("Response TXID: %s", resp.headers["x-txid"])
122
121
  if "RateLimit-Reset" in resp.headers:
@@ -1,12 +1,13 @@
1
1
  """Tesla Fleet API classes."""
2
2
 
3
- from tesla_fleet_api.tesla.vehicle.vehicles import Vehicles
3
+ from tesla_fleet_api.tesla.vehicle.vehicles import Vehicles, VehiclesBluetooth
4
4
  from tesla_fleet_api.tesla.vehicle.fleet import VehicleFleet
5
5
  from tesla_fleet_api.tesla.vehicle.bluetooth import VehicleBluetooth
6
6
  from tesla_fleet_api.tesla.vehicle.signed import VehicleSigned
7
7
 
8
8
  __all__ = [
9
9
  "Vehicles",
10
+ "VehiclesBluetooth",
10
11
  "VehicleFleet",
11
12
  "VehicleBluetooth",
12
13
  "VehicleSigned",