8000 Add reconfigure flow to eheimdigital by autinerd · Pull Request #147930 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

autinerd
Copy link
Contributor
@autinerd autinerd commented Jul 2, 2025

Proposed change

Add the reconfigure flow to eheimdigital.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@frenck frenck requested a review from Copilot July 3, 2025 21:04
@frenck frenck added the smash Indicator this PR is close to finish for merging or closing label Jul 3, 2025
Copy link
Contributor
@Copilot Copilot AI left a 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 in config_flow.py to handle updating host and unique ID.
  • Updates strings.json and quality_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"

Comment on lines +169 to +171
except Exception: # noqa: BLE001
errors["base"] = "unknown"
LOGGER.exception("Unknown exception occurred")
Copy link
Preview
Copilot AI Jul 3, 2025

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.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0