From 158db522a813b921f642cbfda00be58b50f29165 Mon Sep 17 00:00:00 2001 From: SMKRV Date: Thu, 21 Nov 2024 19:16:21 +0300 Subject: [PATCH] Release v2.0.0 --- custom_components/ha_text_ai/__init__.py | 2 +- custom_components/ha_text_ai/coordinator.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/custom_components/ha_text_ai/__init__.py b/custom_components/ha_text_ai/__init__.py index 2968c5e..56f751f 100644 --- a/custom_components/ha_text_ai/__init__.py +++ b/custom_components/ha_text_ai/__init__.py @@ -213,7 +213,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: model=model, temperature=entry.data.get(CONF_TEMPERATURE, DEFAULT_TEMPERATURE), max_tokens=entry.data.get(CONF_MAX_TOKENS, DEFAULT_MAX_TOKENS), - request_interval=entry.data.get(CONF_REQUEST_INTERVAL, DEFAULT_REQUEST_INTERVAL), + request_interval=float(entry.data.get(CONF_REQUEST_INTERVAL, DEFAULT_REQUEST_INTERVAL)), session=session, is_anthropic=is_anthropic ) diff --git a/custom_components/ha_text_ai/coordinator.py b/custom_components/ha_text_ai/coordinator.py index f20c3a3..3a7b695 100644 --- a/custom_components/ha_text_ai/coordinator.py +++ b/custom_components/ha_text_ai/coordinator.py @@ -41,6 +41,14 @@ class HATextAICoordinator(DataUpdateCoordinator): session: Optional[Any] = None, is_anthropic: bool = False, ) -> None: + request_interval = float(request_interval) + + super().__init__( + hass, + _LOGGER, + name=DOMAIN, + update_interval=timedelta(seconds=request_interval), + ) """Initialize coordinator.""" super().__init__( hass,