Skip to content

fix(v1.2.4): OptionsFlowHandler 500 error on reconfiguration#38

Merged
Geek-MD merged 2 commits into
mainfrom
copilot/fix-500-internal-server-error
Mar 16, 2026
Merged

fix(v1.2.4): OptionsFlowHandler 500 error on reconfiguration#38
Geek-MD merged 2 commits into
mainfrom
copilot/fix-500-internal-server-error

Conversation

Copilot AI commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Reconfiguring the integration fails with a 500 Internal Server Error because newer HA versions made config_entry a read-only property on OptionsFlow, breaking the manual assignment in OptionsFlowHandler.__init__.

Changes

  • config_flow.py: Remove OptionsFlowHandler.__init__ entirely — HA automatically injects config_entry. Update async_get_options_flow to return OptionsFlowHandler() with no arguments.
  • manifest.json: Bump version to 1.2.4.
  • CHANGELOG.md: Add v1.2.4 entry.
# Before — raises AttributeError on newer HA
class OptionsFlowHandler(config_entries.OptionsFlow):
    def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
        self.config_entry = config_entry  # ❌ no setter

# After — framework injects config_entry automatically
class OptionsFlowHandler(config_entries.OptionsFlow):
    async def async_step_init(self, user_input=None):
        ...  # self.config_entry is available via the base class property

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

… on reconfiguration

Co-authored-by: Geek-MD <25725990+Geek-MD@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix 500 Internal Server Error during integration reconfiguration fix(v1.2.4): OptionsFlowHandler 500 error on reconfiguration Mar 16, 2026
Copilot AI requested a review from Geek-MD March 16, 2026 01:09
@Geek-MD Geek-MD marked this pull request as ready for review March 16, 2026 01:10
@Geek-MD Geek-MD merged commit 255444e into main Mar 16, 2026
3 checks passed
@Geek-MD Geek-MD deleted the copilot/fix-500-internal-server-error branch March 16, 2026 01:10
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.

2 participants