Skip to content

Commit

Permalink
more useful get_config
Browse files Browse the repository at this point in the history
  • Loading branch information
Bre77 committed Dec 5, 2024
1 parent 9c7fc23 commit 7be3f0c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions teslemetry_stream/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,16 @@ def connected(self) -> bool:

async def get_config(self, vin: str | None = None) -> None:
"""Get the current stream config."""
await self.find_server()
if not self.server:
await self.find_server()
if hasattr(self, 'vehicle'):
await self.vehicle.get_config()

async def find_server(self) -> None:
"""Find the server using metadata."""

req = await self._session.get(
f"https://api.teslemetry.com/api/metadata",
"https://api.teslemetry.com/api/metadata",
headers=self._headers,
raise_for_status=True,
)
Expand Down

0 comments on commit 7be3f0c

Please sign in to comment.