From 48c143b2e867fca400d437a40d1378f90666ea0e Mon Sep 17 00:00:00 2001 From: Krzysztof Strehlau Date: Fri, 7 Feb 2025 09:12:22 +0100 Subject: [PATCH] Fix ha 2025.2 issue related to proxies --- custom_components/groq_cloud_api/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/custom_components/groq_cloud_api/__init__.py b/custom_components/groq_cloud_api/__init__.py index 3fc639d..47fbad1 100644 --- a/custom_components/groq_cloud_api/__init__.py +++ b/custom_components/groq_cloud_api/__init__.py @@ -6,6 +6,7 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_API_KEY, Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady +from homeassistant.helpers.httpx_client import get_async_client from .const import LOGGER @@ -19,7 +20,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: GroqConfigEntry) -> bool LOGGER.info("Setting up %s", entry) - client = groq.AsyncGroq(api_key=entry.data[CONF_API_KEY]) + client = groq.AsyncGroq( + api_key=entry.data[CONF_API_KEY], + http_client=get_async_client(hass) + ) # TODO: I get async errors when trying to call the list function. But this would be the proper way to validate the API key. # try: