Rework and simplify the cleanup of orphan AVM Fritz!Tools entities#117706
Conversation
|
Hey there @mammuth, @AaronDavidSchneider, @chemelli74, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
@coderabbitai review |
WalkthroughThe recent changes to the Fritz integration in Home Assistant focus on improving device and entity management. Key updates include refactoring imports, removing an unused function, and enhancing the logic for handling orphan entities and device removal. These adjustments aim to streamline the cleanup process and ensure better maintenance of the device registry. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
df29c2a to
fd962c4
Compare
Proposed change
This is a rework of the cleanup service in the
fritzintegration.2.1. check if their mac is in list of available physical devices
2.2. if not, store its mac as orphan and remove the entity
3.1. check if it contains any connection related to an orphan mac (from above)
3.2. if yes, remove the config entry from this device
In a follow-up PR (based on #116024 (comment)) this cleanup-service will not be exposed anymore to the user, but will run automatically during coordinator updates, when changes in available physical devices are detected.
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..coveragerc.To help with the load of incoming pull requests: