Skip to content

Fix OptionsFlow AttributeError on Home Assistant 2025.12+ (500 error on options/reconfigure) - #2

Open
ionut531 wants to merge 1 commit into
ygreq:mainfrom
ionut531:fix/options-flow-config-entry-2025-12
Open

Fix OptionsFlow AttributeError on Home Assistant 2025.12+ (500 error on options/reconfigure)#2
ionut531 wants to merge 1 commit into
ygreq:mainfrom
ionut531:fix/options-flow-config-entry-2025-12

Conversation

@ionut531

@ionut531 ionut531 commented Sep 6, 2026

Copy link
Copy Markdown

Problem

Opening the options/reconfigure dialog for this integration fails with a generic 500 Internal Server Error in the UI ("Config flow could not be loaded"). The Home Assistant log shows:

File ".../custom_components/termoalert/config_flow.py", line 107, in __init__
    self.config_entry = config_entry
AttributeError: property 'config_entry' of 'TermoAlertOptionsFlowHandler' object has no setter

Cause

Home Assistant deprecated manually setting OptionsFlow.config_entry in __init__ a while back, and the deprecation period ended in Home Assistant 2025.12 - after that release, config_entry is a read-only property populated automatically by the framework, and the old boilerplate pattern (self.config_entry = config_entry in __init__) raises an AttributeError. This affects every HA version from 2025.12 onward (reproduced and verified fixed on 2026.9.1).

Fix

Removed the __init__ override on TermoAlertOptionsFlowHandler and the config_entry argument passed to it from async_get_options_flow(). Nothing else changes - self.config_entry is still available everywhere it's read later in the class (async_step_init), since the base OptionsFlow class 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant