remove_device and list_devices tools, release 0.10.0 #25

Merged
tim merged 1 commit from feat/device-removal into develop 2026-11-24 11:32:34 +00:00
Owner

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 in config/device_registry/list, picks the config entry (optional when exactly one; required otherwise; a foreign id is refused), then sends config/device_registry/remove_config_entry. Unknown device, ambiguous or foreign entry, and an integration refusal all return a clear error; nothing is sent when a precondition fails. Annotated destructive_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_device docs now point at list_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_entity has one because it is limited to orphans).

🤖 Generated with Claude Code

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 in `config/device_registry/list`, picks the config entry (optional when exactly one; required otherwise; a foreign id is refused), then sends `config/device_registry/remove_config_entry`. Unknown device, ambiguous or foreign entry, and an integration refusal all return a clear `error`; nothing is sent when a precondition fails. Annotated `destructive_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_device` docs now point at `list_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_entity` has one because it is limited to orphans). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add remove_device and list_devices tools, release 0.10.0
All checks were successful
Test & Build / Lint and test (pull_request) Successful in 29s
Test & Build / Build & Push Docker Image (pull_request) Has been skipped
Test & Build / Create Forgejo Release (pull_request) Has been skipped
Security / Security scan (pull_request) Successful in 45s
30d3eef399
remove_device sends config/device_registry/remove_config_entry like the UI
Delete button. config_entry_id is optional for devices with exactly one
config entry; unknown devices, foreign entries and integration refusals
return a clear error. list_devices is a read-only registry lookup with an
optional search. rename_device docs now point at list_devices.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
tim merged commit 1ab8e9a1c3 into develop 2026-11-24 11:32:34 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
tim/hass-mcp!25
No description provided.