From 986c78dd90112d6a6014a1d06009a2ee246836d7 Mon Sep 17 00:00:00 2001 From: SMKRV Date: Tue, 30 Dec 2025 17:10:06 +0300 Subject: [PATCH] fix: Fix OptionsFlowHandler for HA 2024.1+ compatibility - Remove __init__ method that was passing config_entry as argument - OptionsFlow now automatically receives config_entry from base class - Fixes '500 Internal Server Error' when editing existing integrations --- custom_components/ha_text_ai/config_flow.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/custom_components/ha_text_ai/config_flow.py b/custom_components/ha_text_ai/config_flow.py index e6ad02b..2029b01 100644 --- a/custom_components/ha_text_ai/config_flow.py +++ b/custom_components/ha_text_ai/config_flow.py @@ -473,16 +473,12 @@ class HATextAIConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): @callback def async_get_options_flow(config_entry: config_entries.ConfigEntry) -> config_entries.OptionsFlow: """Get the options flow for this handler.""" - return OptionsFlowHandler(config_entry) + return OptionsFlowHandler() class OptionsFlowHandler(config_entries.OptionsFlow): """Handle options flow.""" - def __init__(self, config_entry: config_entries.ConfigEntry) -> None: - """Initialize options flow.""" - self.config_entry = config_entry - async def async_step_init(self, user_input: Optional[Dict[str, Any]] = None) -> FlowResult: """Manage the options.""" if user_input is not None: