From be8a825c19b12f4a114f5cd0f55ebeb15c951da9 Mon Sep 17 00:00:00 2001 From: Teemu Rytilahti Date: Fri, 3 Jan 2025 19:06:16 +0100 Subject: [PATCH] allow https for klaptransport --- kasa/transports/klaptransport.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kasa/transports/klaptransport.py b/kasa/transports/klaptransport.py index 8934b2cc..2cc95c9e 100644 --- a/kasa/transports/klaptransport.py +++ b/kasa/transports/klaptransport.py @@ -125,7 +125,8 @@ class KlapTransport(BaseTransport): self._session_cookie: dict[str, Any] | None = None _LOGGER.debug("Created KLAP transport for %s", self._host) - self._app_url = URL(f"http://{self._host}:{self._port}/app") + protocol = "https" if config.connection_type.https else "http" + self._app_url = URL(f"{protocol}://{self._host}:{self._port}/app") self._request_url = self._app_url / "request" @property