Skip to content

Fix options flow not cleaning up entities on remote deselection - #16

Merged
kongo09 merged 1 commit into
mainfrom
fix-options-flow-cleanup
Mar 6, 2026
Merged

kongo09 merged 1 commit into
mainfrom
fix-options-flow-cleanup

Conversation

@kongo09

@kongo09 kongo09 commented Mar 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • When a remote was deselected via the options flow, its button/number entities and subdevice devices were left behind — contradicting the README which states "Removing a remote deletes all its button and number entities"
  • Added _cleanup_remote_entities() that removes all entities and empty devices for deselected remotes before re-scanning
  • Added test test_options_update_cleans_up_deselected_remote verifying the fix

Test plan

  • python -m pytest tests/ -x -q — 57 tests pass
  • ruff check && ruff format --check — clean

🤖 Generated with Claude Code

When a remote was removed from the watched list via the options flow,
its button/number entities and subdevice devices were left behind
because the re-scan only looked at remotes still in the new list.

Add _cleanup_remote_entities() to remove all entities and empty devices
for deselected remotes before re-scanning.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kongo09
kongo09 merged commit c06cc98 into main Mar 6, 2026
4 checks passed
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