Allow manually removing orphaned lock/gateway devices - #318
Merged
Conversation
A lock or gateway removed from the TTLock account drops out of the next get_locks()/get_gateways() call, but its device stays behind in HA's registry with no entities and no way to delete it. Implement async_remove_config_entry_device to allow manual deletion from the device page, guarded so a still-active lock/gateway can't be removed by mistake. Closes #114 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qps3xgXbFK1fcxd4ZeRgZY
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #318 +/- ##
===========================================
+ Coverage 96.00% 96.02% +0.02%
===========================================
Files 17 17
Lines 1602 1611 +9
===========================================
+ Hits 1538 1547 +9
Misses 64 64 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get_locks()/get_gateways()call, but its device stays behind in HA's registry as an unavailable, entity-less orphan with no way to delete it.async_remove_config_entry_deviceso the device can be manually deleted from HA's device page, guarded so a lock/gateway that's still active on the account can't be removed by mistake (it would just be recreated on the next reload).Closes #114
Test plan
script/checkpasses (lint, type-check, full suite)🤖 Generated with Claude Code
https://claude.ai/code/session_01Qps3xgXbFK1fcxd4ZeRgZY