Skip to content

Commit 3cf60d9

Browse files
omegaatt36claude
andcommitted
fix: remove deprecated config_entry assignment in OptionsFlow
HA 2024.11+ auto-injects config_entry into OptionsFlow instances. Remove manual __init__ and stop passing config_entry to the constructor to eliminate deprecation warnings on modern HA versions. Follows upstream PR tsunglung#25. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 39dad33 commit 3cf60d9

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

custom_components/opencwb/config_flow.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class OpenCWBConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
3939
@callback
4040
def async_get_options_flow(config_entry):
4141
"""Get the options flow for this handler."""
42-
return OpenCWBOptionsFlow(config_entry)
42+
return OpenCWBOptionsFlow()
4343

4444
async def async_step_user(self, user_input=None):
4545
"""Handle a flow initialized by the user."""
@@ -113,11 +113,6 @@ async def async_step_user(self, user_input=None):
113113
class OpenCWBOptionsFlow(config_entries.OptionsFlow):
114114
"""Handle options."""
115115

116-
def __init__(self, config_entry):
117-
"""Initialize options flow."""
118-
if (MAJOR_VERSION, MINOR_VERSION) < (2024, 11):
119-
self.config_entry = config_entry
120-
121116
async def async_step_init(self, user_input=None):
122117
"""Manage the options."""
123118
if user_input is not None:

0 commit comments

Comments
 (0)