-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Add reconfigure flow to eheimdigital #147930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for reconfiguring an existing Eheim Digital integration without removing the entry.
- Implements
async_step_reconfigure
inconfig_flow.py
to handle updating host and unique ID. - Updates
strings.json
andquality_scale.yaml
to include reconfigure-specific messages and mark the rule as done. - Adds tests for successful reconfigure, connection failures, and unique ID mismatches in
test_config_flow.py
.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
config_flow.py | Added async_step_reconfigure implementation |
strings.json | Added translation keys for reconfigure flow and abort reasons |
quality_scale.yaml | Marked reconfiguration-flow rule as done |
tests/components/eheimdigital/test_config_flow.py | Added unit tests covering reconfigure scenarios |
Comments suppressed due to low confidence (2)
homeassistant/components/eheimdigital/strings.json:28
- [nitpick] Consider using a translation key or aligning this message with other common config flow abort messages to maintain consistency and support localization.
"unique_id_mismatch": "The identifier does not match the previous identifier"
tests/components/eheimdigital/test_config_flow.py:260
- It may be useful to also assert that the config entry's data (e.g.,
host
) was correctly updated after a successful reconfigure to fully verify the data migration.
assert result["reason"] == "reconfigure_successful"
except Exception: # noqa: BLE001 | ||
errors["base"] = "unknown" | ||
LOGGER.exception("Unknown exception occurred") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catching a broad Exception
can mask unexpected errors; consider narrowing this to specific exception types or re-raising unexpected ones to avoid hiding critical failures.
except Exception: # noqa: BLE001 | |
errors["base"] = "unknown" | |
LOGGER.exception("Unknown exception occurred") | |
except Exception as err: # noqa: BLE001 | |
LOGGER.exception("Unexpected exception occurred: %s", err) | |
raise |
Copilot uses AI. Check for mistakes.
Proposed change
Add the reconfigure flow to eheimdigital.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: