-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
63 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from __future__ import annotations | ||
from typing import TYPE_CHECKING, Any | ||
|
||
from ..const import Method | ||
from ..tesla.vehicle.proto.universal_message_pb2 import Domain | ||
from ..tesla.vehicle.vehicle import Vehicle | ||
from ..tesla.vehicle.vehicles import Vehicles | ||
from ..tesla.vehicle.bluetooth import VehicleBluetooth | ||
from ..tesla.vehicle.fleet import VehicleFleet | ||
|
||
if TYPE_CHECKING: | ||
from .tessie import Tessie | ||
|
||
class TessieVehicle(Vehicle): | ||
"""Tessie specific base vehicle.""" | ||
pass | ||
|
||
class TessieVehicleFleet(VehicleFleet): | ||
"""Tessie specific API vehicle.""" | ||
pass | ||
|
||
class TessieVehicles(Vehicles): | ||
"""Class containing and creating vehicles.""" | ||
|
||
def create(self, vin: str) -> TessieVehicleFleet: | ||
"""Creates a specific vehicle.""" | ||
return self.createFleet(vin) | ||
|
||
def createFleet(self, vin: str) -> TessieVehicleFleet: | ||
"""Creates a specific vehicle.""" | ||
vehicle = TessieVehicleFleet(self._parent, vin) | ||
self[vin] = vehicle | ||
return vehicle | ||
|
||
def createSigned(self, vin: str): | ||
"""Creates a specific vehicle.""" | ||
raise NotImplementedError("Signing is handled by Tessie server-side") | ||
|
||
def createBluetooth(self, vin: str): | ||
"""Creates a specific vehicle.""" | ||
raise NotImplementedError("Bluetooth is only handled locally") |