tesla-fleet-api 0.8.4__tar.gz → 0.9.0__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {tesla_fleet_api-0.8.4/tesla_fleet_api.egg-info → tesla_fleet_api-0.9.0}/PKG-INFO +4 -1
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/setup.py +2 -2
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/const.py +5 -1
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/teslafleetoauth.py +1 -1
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/teslemetry.py +20 -9
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/vehicle.py +1 -1
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0/tesla_fleet_api.egg-info}/PKG-INFO +4 -1
- tesla_fleet_api-0.9.0/tesla_fleet_api.egg-info/requires.txt +5 -0
- tesla_fleet_api-0.8.4/tesla_fleet_api.egg-info/requires.txt +0 -2
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/LICENSE +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/README.md +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/setup.cfg +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/__init__.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/charging.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/energy.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/energyspecific.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/exceptions.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/partner.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/pb2/__init__.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/pb2/__init__.pyi +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/pb2/car_server_pb2.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/pb2/common_pb2.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/pb2/errors_pb2.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/pb2/keys_pb2.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/pb2/signatures_pb2.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/pb2/universal_message_pb2.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/pb2/vcsec_pb2.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/pb2/vehicle_pb2.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/ratecalculator.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/teslafleetapi.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/teslafleetopensource.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/tessie.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/user.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/vehiclesigned.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/vehiclespecific.py +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api.egg-info/SOURCES.txt +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api.egg-info/dependency_links.txt +0 -0
- {tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: tesla_fleet_api
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.9.0
|
4
4
|
Summary: Tesla Fleet API library for Python
|
5
5
|
Home-page: https://github.com/Teslemetry/tesla_fleet_api
|
6
6
|
Author: Brett Adams
|
@@ -13,7 +13,10 @@ Requires-Python: >=3.10
|
|
13
13
|
Description-Content-Type: text/markdown
|
14
14
|
License-File: LICENSE
|
15
15
|
Requires-Dist: aiohttp
|
16
|
+
Requires-Dist: aiofiles
|
16
17
|
Requires-Dist: aiolimiter
|
18
|
+
Requires-Dist: cryptography
|
19
|
+
Requires-Dist: protobuf
|
17
20
|
|
18
21
|
# Tesla Fleet Api
|
19
22
|
Python library for Tesla Fleet API and Teslemetry.
|
@@ -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.
|
8
|
+
version="0.9.0",
|
9
9
|
author="Brett Adams",
|
10
10
|
author_email="hello@teslemetry.com",
|
11
11
|
description="Tesla Fleet API library for Python",
|
@@ -20,5 +20,5 @@ setuptools.setup(
|
|
20
20
|
"Operating System :: OS Independent",
|
21
21
|
],
|
22
22
|
python_requires=">=3.10",
|
23
|
-
install_requires=["aiohttp", "aiolimiter"],
|
23
|
+
install_requires=["aiohttp", "aiofiles", "aiolimiter", "cryptography", "protobuf"],
|
24
24
|
)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
from enum import Enum
|
4
4
|
import logging
|
5
5
|
|
6
|
-
VERSION = "0.
|
6
|
+
VERSION = "1.0.0"
|
7
7
|
LOGGER = logging.getLogger(__package__)
|
8
8
|
SERVERS = {
|
9
9
|
"na": "https://fleet-api.prd.na.vn.cloud.tesla.com",
|
@@ -88,11 +88,14 @@ class VehicleDataEndpoint(StrEnum):
|
|
88
88
|
DRIVE_STATE = "drive_state"
|
89
89
|
GUI_SETTINGS = "gui_settings"
|
90
90
|
LOCATION_DATA = "location_data"
|
91
|
+
CHARGE_SCHEDULE_DATA = "charge_schedule_data"
|
92
|
+
PRECONDITIONING_SCHEDULE_DATA = "preconditioning_schedule_data"
|
91
93
|
VEHICLE_CONFIG = "vehicle_config"
|
92
94
|
VEHICLE_STATE = "vehicle_state"
|
93
95
|
VEHICLE_DATA_COMBO = "vehicle_data_combo"
|
94
96
|
|
95
97
|
|
98
|
+
|
96
99
|
class SunRoofCommand(StrEnum):
|
97
100
|
"""Sunroof options"""
|
98
101
|
|
@@ -125,6 +128,7 @@ class Scope(StrEnum):
|
|
125
128
|
OFFLINE_ACCESS = "offline_access"
|
126
129
|
USER_DATA = "user_data"
|
127
130
|
VEHICLE_DEVICE_DATA = "vehicle_device_data"
|
131
|
+
VEHICLE_LOCATION = "vehicle_location"
|
128
132
|
VEHICLE_CMDS = "vehicle_cmds"
|
129
133
|
VEHICLE_CHARGING_CMDS = "vehicle_charging_cmds"
|
130
134
|
ENERGY_DEVICE_DATA = "energy_device_data"
|
@@ -45,7 +45,7 @@ class TeslaFleetOAuth(TeslaFleetApi):
|
|
45
45
|
"""Get the login URL."""
|
46
46
|
if self.redirect_uri is None:
|
47
47
|
raise ValueError("Redirect URI is missing")
|
48
|
-
return f"https://auth.tesla.com/oauth2/v3/authorize?response_type=code&prompt=login&client_id={self.client_id}&redirect_uri={self.redirect_uri}&scope={'
|
48
|
+
return f"https://auth.tesla.com/oauth2/v3/authorize?response_type=code&prompt=login&client_id={self.client_id}&redirect_uri={self.redirect_uri}&scope={'+'.join(scopes)}&state={state}"
|
49
49
|
|
50
50
|
async def get_refresh_token(self, code: str) -> None:
|
51
51
|
"""Get the refresh token."""
|
@@ -1,15 +1,10 @@
|
|
1
|
+
from typing import Any
|
2
|
+
|
1
3
|
import aiohttp
|
2
4
|
from aiolimiter import AsyncLimiter
|
3
|
-
from typing import Any
|
4
|
-
from .teslafleetapi import TeslaFleetApi
|
5
|
-
from .charging import Charging
|
6
|
-
from .energy import Energy
|
7
|
-
from .partner import Partner
|
8
|
-
from .user import User
|
9
|
-
from .vehicle import Vehicle
|
10
|
-
from .vehiclespecific import VehicleSpecific
|
11
5
|
|
12
|
-
from .const import
|
6
|
+
from .const import LOGGER, Method, VehicleDataEndpoint
|
7
|
+
from .teslafleetapi import TeslaFleetApi
|
13
8
|
|
14
9
|
# Rate limit should be global, even if multiple instances are created
|
15
10
|
rate_limit = AsyncLimiter(5, 10)
|
@@ -101,6 +96,22 @@ class Teslemetry(TeslaFleetApi):
|
|
101
96
|
)
|
102
97
|
).get("response")
|
103
98
|
|
99
|
+
async def vehicle_force_refresh(self, vin: str) -> dict[str, Any]:
|
100
|
+
"""Force a refresh of the vehicle data."""
|
101
|
+
return await self._request(
|
102
|
+
Method.GET,
|
103
|
+
f"api/force/{vin}",
|
104
|
+
)
|
105
|
+
|
106
|
+
async def vehicle_data_cached(self, vin: str, endpoints: list[VehicleDataEndpoint | str] | None = None,) -> dict[str, Any]:
|
107
|
+
"""Get cached vehicle data."""
|
108
|
+
endpoint_payload = ";".join(endpoints) if endpoints else None
|
109
|
+
return await self._request(
|
110
|
+
Method.GET,
|
111
|
+
f"api/x/vehicles/{vin}/vehicle_data",
|
112
|
+
{"endpoints": endpoint_payload}
|
113
|
+
)
|
114
|
+
|
104
115
|
async def _request(
|
105
116
|
self,
|
106
117
|
method: Method,
|
@@ -737,7 +737,7 @@ class Vehicle:
|
|
737
737
|
async def vehicle_data(
|
738
738
|
self,
|
739
739
|
vehicle_tag: str | int,
|
740
|
-
endpoints:
|
740
|
+
endpoints: list[VehicleDataEndpoint | str] | None = None,
|
741
741
|
) -> dict[str, Any]:
|
742
742
|
"""Makes a live call to the vehicle. This may return cached data if the vehicle is offline. For vehicles running firmware versions 2023.38+, location_data is required to fetch vehicle location. This will result in a location sharing icon to show on the vehicle UI."""
|
743
743
|
endpoint_payload = ";".join(endpoints) if endpoints else None
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: tesla_fleet_api
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.9.0
|
4
4
|
Summary: Tesla Fleet API library for Python
|
5
5
|
Home-page: https://github.com/Teslemetry/tesla_fleet_api
|
6
6
|
Author: Brett Adams
|
@@ -13,7 +13,10 @@ Requires-Python: >=3.10
|
|
13
13
|
Description-Content-Type: text/markdown
|
14
14
|
License-File: LICENSE
|
15
15
|
Requires-Dist: aiohttp
|
16
|
+
Requires-Dist: aiofiles
|
16
17
|
Requires-Dist: aiolimiter
|
18
|
+
Requires-Dist: cryptography
|
19
|
+
Requires-Dist: protobuf
|
17
20
|
|
18
21
|
# Tesla Fleet Api
|
19
22
|
Python library for Tesla Fleet API and Teslemetry.
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api/pb2/universal_message_pb2.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{tesla_fleet_api-0.8.4 → tesla_fleet_api-0.9.0}/tesla_fleet_api.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|