remove_device and list_devices tools, release 0.10.0 #25
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/device-removal"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds device removal as the UI Delete button does it, plus a read-only device lookup.
remove_device(device_id, config_entry_id=None): looks the device up inconfig/device_registry/list, picks the config entry (optional when exactly one; required otherwise; a foreign id is refused), then sendsconfig/device_registry/remove_config_entry. Unknown device, ambiguous or foreign entry, and an integration refusal all return a clearerror; nothing is sent when a precondition fails. Annotateddestructive_hint=True.list_devices(search=None): read-only, lean fields (id, name, name_by_user, manufacturer, model, area_id, disabled_by, config_entries), case-insensitive search.rename_devicedocs now point atlist_devices; README lists the three device tools; version 0.10.0 with CHANGELOG.Verified: websocket mocked throughout (never run against the real HA). 375 passed, coverage 92.4% (gate 90%), new code fully covered; ruff, ruff format, mypy, bandit clean. No dead code found in the touched areas.
No confirm/dry-run flag, per the task spec (
remove_registry_entityhas one because it is limited to orphans).🤖 Generated with Claude Code