Skip to content

Commit

Permalink
Remove vehicle specific subscriptions from Teslemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
Bre77 committed Jan 11, 2024
1 parent 2dda3ab commit 4a28230
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions tesla_fleet_api/teslemetry.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
import aiohttp
from .teslafleetapi import TeslaFleetApi
from .vehicle import Vehicle
from .vehiclespecific import VehicleSpecific
from .const import Methods


class TeslemetryVehicle(Vehicle):
"""Tesla Fleet API Vehicle."""

async def create(self, only_subscribed=True) -> [VehicleSpecific]:
"""Creates a class for each vehicle."""
if only_subscribed:
return [VehicleSpecific(self, vin) for vin in await self._parent.vehicles()]
return await super().create()


class Teslemetry(TeslaFleetApi):
def __init__(
self,
Expand All @@ -31,15 +19,13 @@ def __init__(
raise_for_status=raise_for_status,
partner_scope=False,
user_scope=False,
vehicle_scope=False,
)
self.vehicle = TeslemetryVehicle(self)

async def vehicles(self):
async def subscription(self):
"""Get the subscribed vehicles."""
return await self._request(
Methods.GET,
"/meta/vehicles",
"/meta/subscription",
)

async def find_server(self):
Expand Down

0 comments on commit 4a28230

Please sign in to comment.