Skip to content

Commit 6678bea

Browse files
committed
WIP
1 parent 1f2c7e3 commit 6678bea

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tesla_fleet_api/Teslemetry.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,28 @@ def __init__(
1818
raise_for_status=raise_for_status,
1919
)
2020

21+
async def subscriptions(self):
22+
"""Get the subscriptions."""
23+
raise NotImplementedError("Not implemented yet")
24+
return await self.get(
25+
"/meta/subscriptions",
26+
{"headers": {"Authorization": f"Bearer {self.access_token}"}},
27+
)
28+
2129
async def find_server(self):
2230
"""Find the server URL for the Tesla Fleet API."""
2331
raise NotImplementedError("Do not use this function for Teslemetry.")
2432

2533
def stream(self, vin: str, fields, alerts, expire: int):
2634
"""Stream data from the Tesla Fleet API."""
2735
raise NotImplementedError("Not implemented yet")
36+
37+
class Vehicle(TeslaFleetApi.Vehicle):
38+
"""Tesla Fleet API Vehicle."""
39+
40+
async def create(
41+
self, only_subscribed=False
42+
) -> [TeslaFleetApi.Vehicle.Specific]:
43+
"""Creates a class for each vehicle."""
44+
list = await self.list()
45+
return [self.Specific(self, x["vin"]) for x in list["response"]]

0 commit comments

Comments
 (0)