From da5a723777283372ff03163cedeac4816bd48d07 Mon Sep 17 00:00:00 2001 From: Julian Pawlowski Date: Sun, 9 Nov 2025 16:04:12 +0000 Subject: [PATCH] fix: update return type annotation for API request method and ensure exceptions are raised --- custom_components/tibber_prices/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/tibber_prices/api.py b/custom_components/tibber_prices/api.py index 3a3c76e..ba1f774 100644 --- a/custom_components/tibber_prices/api.py +++ b/custom_components/tibber_prices/api.py @@ -576,7 +576,7 @@ class TibberPricesApiClient: headers: dict[str, str], data: dict, query_type: QueryType, - ) -> dict: + ) -> dict[str, Any]: """Make an API request with comprehensive error handling for network issues.""" _LOGGER.debug("Making API request with data: %s", data) @@ -633,9 +633,11 @@ class TibberPricesApiClient: except socket.gaierror as error: self._handle_dns_error(error) + raise # Ensure type checker knows this path always raises except OSError as error: self._handle_network_error(error) + raise # Ensure type checker knows this path always raises def _handle_dns_error(self, error: socket.gaierror) -> None: """Handle DNS resolution errors with IPv4/IPv6 dual stack considerations."""