From 7be3f0c8e42f38f57e68912cb2bd95431cc596b2 Mon Sep 17 00:00:00 2001 From: Brett Date: Thu, 5 Dec 2024 13:21:52 +1000 Subject: [PATCH] more useful get_config --- teslemetry_stream/stream.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/teslemetry_stream/stream.py b/teslemetry_stream/stream.py index 5158713..158b05e 100644 --- a/teslemetry_stream/stream.py +++ b/teslemetry_stream/stream.py @@ -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, )