tesla-fleet-api 0.5.0__tar.gz → 0.5.1__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.
- {tesla_fleet_api-0.5.0/tesla_fleet_api.egg-info → tesla_fleet_api-0.5.1}/PKG-INFO +1 -1
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/setup.py +1 -1
- tesla_fleet_api-0.5.1/tesla_fleet_api/tessie.py +75 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api/vehicle.py +2 -2
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api/vehiclespecific.py +5 -3
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1/tesla_fleet_api.egg-info}/PKG-INFO +1 -1
- tesla_fleet_api-0.5.0/tesla_fleet_api/tessie.py +0 -27
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/LICENSE +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/README.md +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/setup.cfg +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api/__init__.py +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api/charging.py +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api/const.py +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api/energy.py +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api/energyspecific.py +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api/exceptions.py +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api/partner.py +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api/teslafleetapi.py +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api/teslafleetoauth.py +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api/teslemetry.py +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api/user.py +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api.egg-info/SOURCES.txt +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api.egg-info/dependency_links.txt +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api.egg-info/requires.txt +0 -0
- {tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api.egg-info/top_level.txt +0 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
import aiohttp
|
2
|
+
from typing import Any
|
3
|
+
from .teslafleetapi import TeslaFleetApi
|
4
|
+
from .const import Method
|
5
|
+
from .vehiclespecific import VehicleSpecific
|
6
|
+
|
7
|
+
|
8
|
+
class Tessie(TeslaFleetApi):
|
9
|
+
def __init__(
|
10
|
+
self,
|
11
|
+
session: aiohttp.ClientSession,
|
12
|
+
access_token: str,
|
13
|
+
raise_for_status: bool = True,
|
14
|
+
):
|
15
|
+
"""Initialize the Tessie API."""
|
16
|
+
super().__init__(
|
17
|
+
session,
|
18
|
+
access_token,
|
19
|
+
server="https://api.tessie.com",
|
20
|
+
raise_for_status=raise_for_status,
|
21
|
+
partner_scope=False,
|
22
|
+
user_scope=False,
|
23
|
+
energy_scope=False,
|
24
|
+
)
|
25
|
+
|
26
|
+
async def find_server(self):
|
27
|
+
"""Find the server URL for the Tesla Fleet API."""
|
28
|
+
raise NotImplementedError("Do not use this function for Tessie.")
|
29
|
+
|
30
|
+
async def vehicles(self, only_active: bool = False) -> Any:
|
31
|
+
"""Get vehicles."""
|
32
|
+
return await self._request(
|
33
|
+
Method.GET, "vehicles", params={"only_active": only_active}
|
34
|
+
)
|
35
|
+
|
36
|
+
async def state(self, vin: str) -> Any:
|
37
|
+
"""Get vehicle data."""
|
38
|
+
return await self._request(Method.GET, f"{vin}/state")
|
39
|
+
|
40
|
+
async def battery(self, vin: str) -> Any:
|
41
|
+
"""Get battery data."""
|
42
|
+
return await self._request(Method.GET, f"{vin}/battery")
|
43
|
+
|
44
|
+
async def battery_health(
|
45
|
+
self,
|
46
|
+
vin: str,
|
47
|
+
start: int | None = None,
|
48
|
+
end: int | None = None,
|
49
|
+
distance_format: str | None = None,
|
50
|
+
) -> Any:
|
51
|
+
"""Get battery health data."""
|
52
|
+
return await self._request(
|
53
|
+
Method.GET,
|
54
|
+
f"{vin}/battery_health",
|
55
|
+
params={"from": start, "to": end, "distance_format": distance_format},
|
56
|
+
)
|
57
|
+
|
58
|
+
async def all_battery_health(
|
59
|
+
self,
|
60
|
+
start: int | None = None,
|
61
|
+
end: int | None = None,
|
62
|
+
distance_format: str | None = None,
|
63
|
+
only_active: bool = False,
|
64
|
+
) -> Any:
|
65
|
+
"""Get battery health data."""
|
66
|
+
return await self._request(
|
67
|
+
Method.GET,
|
68
|
+
"battery_health",
|
69
|
+
params={
|
70
|
+
"from": start,
|
71
|
+
"to": end,
|
72
|
+
"distance_format": distance_format,
|
73
|
+
"only_active": only_active,
|
74
|
+
},
|
75
|
+
)
|
@@ -189,7 +189,7 @@ class Vehicle:
|
|
189
189
|
)
|
190
190
|
|
191
191
|
async def navigation_gps_request(
|
192
|
-
self, vehicle_tag: str | int, lat: float, lon: float, order: int
|
192
|
+
self, vehicle_tag: str | int, lat: float, lon: float, order: int | None = None
|
193
193
|
) -> dict[str, Any]:
|
194
194
|
"""Start navigation to given coordinates. Order can be used to specify order of multiple stops."""
|
195
195
|
return await self._request(
|
@@ -209,7 +209,7 @@ class Vehicle:
|
|
209
209
|
)
|
210
210
|
|
211
211
|
async def navigation_sc_request(
|
212
|
-
self, vehicle_tag: str | int, id: int, order: int
|
212
|
+
self, vehicle_tag: str | int, id: int, order: int | None = None
|
213
213
|
) -> dict[str, Any]:
|
214
214
|
"""Sends a location to the in-vehicle navigation system."""
|
215
215
|
return await self._request(
|
@@ -114,10 +114,10 @@ class VehicleSpecific:
|
|
114
114
|
return await self._parent.media_volume_down(self.vin)
|
115
115
|
|
116
116
|
async def navigation_gps_request(
|
117
|
-
self, lat: float, lon: float, order: int
|
117
|
+
self, lat: float, lon: float, order: int | None = None
|
118
118
|
) -> dict[str, Any]:
|
119
119
|
"""Start navigation to given coordinates. Order can be used to specify order of multiple stops."""
|
120
|
-
self._parent.navigation_gps_request(self.vin, lat, lon, order)
|
120
|
+
return await self._parent.navigation_gps_request(self.vin, lat, lon, order)
|
121
121
|
|
122
122
|
async def navigation_request(
|
123
123
|
self, type: str, locale: str, timestamp_ms: str
|
@@ -127,7 +127,9 @@ class VehicleSpecific:
|
|
127
127
|
self.vin, type, locale, timestamp_ms
|
128
128
|
)
|
129
129
|
|
130
|
-
async def navigation_sc_request(
|
130
|
+
async def navigation_sc_request(
|
131
|
+
self, id: int, order: int | None = None
|
132
|
+
) -> dict[str, Any]:
|
131
133
|
"""Sends a location to the in-vehicle navigation system."""
|
132
134
|
return await self._parent.navigation_sc_request(self.vin, id, order)
|
133
135
|
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import aiohttp
|
2
|
-
from typing import Any
|
3
|
-
from .teslafleetapi import TeslaFleetApi
|
4
|
-
from .const import Method
|
5
|
-
|
6
|
-
|
7
|
-
class Tessie(TeslaFleetApi):
|
8
|
-
def __init__(
|
9
|
-
self,
|
10
|
-
session: aiohttp.ClientSession,
|
11
|
-
access_token: str,
|
12
|
-
raise_for_status: bool = True,
|
13
|
-
):
|
14
|
-
"""Initialize the Tessie API."""
|
15
|
-
super().__init__(
|
16
|
-
session,
|
17
|
-
access_token,
|
18
|
-
server="https://api.tessie.com",
|
19
|
-
raise_for_status=raise_for_status,
|
20
|
-
partner_scope=False,
|
21
|
-
user_scope=False,
|
22
|
-
energy_scope=False,
|
23
|
-
)
|
24
|
-
|
25
|
-
async def find_server(self):
|
26
|
-
"""Find the server URL for the Tesla Fleet API."""
|
27
|
-
raise NotImplementedError("Do not use this function for 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
|
{tesla_fleet_api-0.5.0 → tesla_fleet_api-0.5.1}/tesla_fleet_api.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|