From ff2f7627d8e49ba48d0aab902abb2276eb6f2e90 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Mar 2026 01:06:43 +0000 Subject: [PATCH 1/2] Initial plan From 39dad4bded9cf5346e36ad8a10884e279015a750 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Mar 2026 01:09:03 +0000 Subject: [PATCH 2/2] fix(v1.2.4): remove OptionsFlowHandler.__init__ to fix AttributeError on reconfiguration Co-authored-by: Geek-MD <25725990+Geek-MD@users.noreply.github.com> --- CHANGELOG.md | 5 +++++ custom_components/usgs_earthquakes_feed/config_flow.py | 6 +----- custom_components/usgs_earthquakes_feed/manifest.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 198b5fb..c2fab77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## [1.2.4] - 2026-03-16 + +### Fixed +- **`OptionsFlowHandler` no longer raises `AttributeError` on reconfiguration**: Removed the `__init__` method from `OptionsFlowHandler` that tried to set `self.config_entry = config_entry`. In newer versions of Home Assistant, `config_entry` is a read-only property on `OptionsFlow` and is automatically injected by the framework. The `async_get_options_flow` method now returns `OptionsFlowHandler()` without passing `config_entry` manually. + ## [1.2.3] - 2026-03-15 ### Fixed diff --git a/custom_components/usgs_earthquakes_feed/config_flow.py b/custom_components/usgs_earthquakes_feed/config_flow.py index bbdd4da..4445d0a 100644 --- a/custom_components/usgs_earthquakes_feed/config_flow.py +++ b/custom_components/usgs_earthquakes_feed/config_flow.py @@ -35,7 +35,7 @@ def async_get_options_flow( config_entry: config_entries.ConfigEntry, ) -> OptionsFlowHandler: """Get the options flow for this handler.""" - return OptionsFlowHandler(config_entry) + return OptionsFlowHandler() async def async_step_user( self, @@ -85,10 +85,6 @@ async def async_step_user( class OptionsFlowHandler(config_entries.OptionsFlow): """Handle options flow for USGS Quakes.""" - 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: dict[str, Any] | None = None ) -> FlowResult: diff --git a/custom_components/usgs_earthquakes_feed/manifest.json b/custom_components/usgs_earthquakes_feed/manifest.json index ff0cd4c..c33cf9f 100644 --- a/custom_components/usgs_earthquakes_feed/manifest.json +++ b/custom_components/usgs_earthquakes_feed/manifest.json @@ -13,5 +13,5 @@ "aio-geojson-usgs-earthquakes==0.3", "aio-geojson-client==0.12" ], - "version": "1.2.3" + "version": "1.2.4" }