Fix OptionsFlow AttributeError on Home Assistant 2025.12+ (500 error on options/reconfigure) - #2
Open
ionut531 wants to merge 1 commit into
Open
Conversation
HA 2025.12 finished the deprecation of manually setting OptionsFlow.config_entry in __init__: it is now a read-only property populated by the framework. The old boilerplate pattern now raises: AttributeError: property 'config_entry' of 'TermoAlertOptionsFlowHandler' object has no setter ...on any attempt to open the options/reconfigure dialog (surfaces in the UI as a generic 500 Internal Server Error on the config flow endpoint). Fix: drop the __init__ override and the config_entry argument passed to it in async_get_options_flow(); config_entry is still available via the inherited property everywhere it's read later in the class. Reproduced and fixed against Home Assistant 2026.9.1; the underlying framework change shipped in 2025.12, so this affects every HA version from 2025.12 onward.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Opening the options/reconfigure dialog for this integration fails with a generic
500 Internal Server Errorin the UI ("Config flow could not be loaded"). The Home Assistant log shows:Cause
Home Assistant deprecated manually setting
OptionsFlow.config_entryin__init__a while back, and the deprecation period ended in Home Assistant 2025.12 - after that release,config_entryis a read-only property populated automatically by the framework, and the old boilerplate pattern (self.config_entry = config_entryin__init__) raises anAttributeError. This affects every HA version from 2025.12 onward (reproduced and verified fixed on 2026.9.1).Fix
Removed the
__init__override onTermoAlertOptionsFlowHandlerand theconfig_entryargument passed to it fromasync_get_options_flow(). Nothing else changes -self.config_entryis still available everywhere it's read later in the class (async_step_init), since the baseOptionsFlowclass now sets it for you.Tested locally: options flow opens and saves correctly on HA 2026.9.1.
Affected Home Assistant versions
Any Home Assistant version 2025.12 or later.