Skip to content

Conversation

@rootnegativ1
Copy link
Contributor

When adding a new folding instance, my HA logs now show the following warning:

2024-12-21 06:10:28.977 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'foldingathomecontrol' sets option flow config_entry explicitly, which is deprecated at custom_components/foldingathomecontrol/config_flow.py, line 85: self.config_entry = config_entry. This will stop working in Home Assistant 2025.12, please create a bug report at https://github.com/eifinger/hass-foldingathomecontrol/issues

Looks like this was deprecated in November 2024 per the dev blog

@rootnegativ1
Copy link
Contributor Author

Originally, this PR removed one of the arguments from FoldingAtHomeControlOptionsFlowHandler.__init__(), but this throws an error in test_options_flow:

def __init__(self) -> None:
    """Initialize FoldingAtHomeControl options flow."""
test_options_flow TypeError: FoldingAtHomeControlOptionsFlowHandler.__init__() takes 1 positional argument but 2 were given

When re-adding the 2nd argument but commenting out the deprecation, a different error occurs:

def __init__(self, config_entry) -> None:
    """Initialize FoldingAtHomeControl options flow."""
    #self.config_entry = config_entry
test_options_flow AttributeError: 'FoldingAtHomeControlOptionsFlowHandler' object has no attribute 'config_entry'

Both iterations of __init__() seem to run fine in HA, but I'm not sure how to handle validation testing. Looks like I'll be learning about testing in the future.

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