|
1248 | 1248 | { |
1249 | 1249 | "name": "ha_config_remove_group", |
1250 | 1250 | "title": "Remove Group", |
1251 | | - "description": "Remove a service-based Home Assistant entity group via the group.remove service.\n\n**When NOT to use:** for groups created through `ha_config_set_helper(helper_type=\"group\", ...)`,\nuse `ha_delete_helpers_integrations`. Those config-entry-backed groups are not reachable via the\ngroup.remove service.\n\n**When to use:** removing groups created with `ha_config_set_group` or defined in YAML\nvia `group:` configuration. Config-entry-backed deletion tools cannot find these.\n\nEXAMPLES:\n- Remove group: ha_config_remove_group(\"living_room_lights\")\n\nUse ha_config_list_groups() to find existing groups.\n\n**WARNING:**\n- Removing a group used in automations may cause those automations to fail.\n- Groups defined in YAML can be removed at runtime but will reappear after restart.\n- This only removes old-style groups, not platform-specific groups.", |
| 1251 | + "description": "Remove a service-based Home Assistant entity group via the group.remove service.\n\n**When NOT to use:** for groups created through `ha_config_set_helper(helper_type=\"group\", ...)`,\nuse `ha_remove_helpers_integrations`. Those config-entry-backed groups are not reachable via the\ngroup.remove service.\n\n**When to use:** removing groups created with `ha_config_set_group` or defined in YAML\nvia `group:` configuration. Config-entry-backed deletion tools cannot find these.\n\nEXAMPLES:\n- Remove group: ha_config_remove_group(\"living_room_lights\")\n\nUse ha_config_list_groups() to find existing groups.\n\n**WARNING:**\n- Removing a group used in automations may cause those automations to fail.\n- Groups defined in YAML can be removed at runtime but will reappear after restart.\n- This only removes old-style groups, not platform-specific groups.", |
1252 | 1252 | "inputSchema": { |
1253 | 1253 | "properties": { |
1254 | 1254 | "object_id": { |
|
1275 | 1275 | { |
1276 | 1276 | "name": "ha_config_set_group", |
1277 | 1277 | "title": "Create or Update Group", |
1278 | | - "description": "Create or update a service-based Home Assistant entity group via the group.set service.\n\n**When NOT to use:** for typical \"combine these entities into one controllable group\"\nrequests, prefer `ha_config_set_helper(helper_type=\"group\", ...)`. Config-entry-backed\ngroups are registered in the entity registry, so `ha_set_entity` can assign them to\nareas and they are deletable via `ha_delete_helpers_integrations`.\n\n**When to use:** compatibility with existing groups already configured via group.set\nor YAML, or the rare case where entity-registry membership is explicitly unwanted.\nGroups created here are only removable via `ha_config_remove_group` —\n`ha_delete_helpers_integrations` will not find them.\n\n**For NEW groups:** Provide object_id and entities (required).\n**For EXISTING groups:** Provide object_id and any fields to update.\n\nEXAMPLES:\n- Create group: ha_config_set_group(\"bedroom_lights\", entities=[\"light.lamp\", \"light.ceiling\"])\n- Create with name: ha_config_set_group(\"sensors\", entities=[\"sensor.temp\"], name=\"All Sensors\")\n- Update name: ha_config_set_group(\"lights\", name=\"Living Room Lights\")\n- Add entities: ha_config_set_group(\"lights\", add_entities=[\"light.extra\"])\n- Remove entities: ha_config_set_group(\"lights\", remove_entities=[\"light.old\"])\n- Replace all entities: ha_config_set_group(\"lights\", entities=[\"light.new1\", \"light.new2\"])\n\n**NOTE:** entities, add_entities, and remove_entities are mutually exclusive.", |
| 1278 | + "description": "Create or update a service-based Home Assistant entity group via the group.set service.\n\n**When NOT to use:** for typical \"combine these entities into one controllable group\"\nrequests, prefer `ha_config_set_helper(helper_type=\"group\", ...)`. Config-entry-backed\ngroups are registered in the entity registry, so `ha_set_entity` can assign them to\nareas and they are deletable via `ha_remove_helpers_integrations`.\n\n**When to use:** compatibility with existing groups already configured via group.set\nor YAML, or the rare case where entity-registry membership is explicitly unwanted.\nGroups created here are only removable via `ha_config_remove_group` —\n`ha_remove_helpers_integrations` will not find them.\n\n**For NEW groups:** Provide object_id and entities (required).\n**For EXISTING groups:** Provide object_id and any fields to update.\n\nEXAMPLES:\n- Create group: ha_config_set_group(\"bedroom_lights\", entities=[\"light.lamp\", \"light.ceiling\"])\n- Create with name: ha_config_set_group(\"sensors\", entities=[\"sensor.temp\"], name=\"All Sensors\")\n- Update name: ha_config_set_group(\"lights\", name=\"Living Room Lights\")\n- Add entities: ha_config_set_group(\"lights\", add_entities=[\"light.extra\"])\n- Remove entities: ha_config_set_group(\"lights\", remove_entities=[\"light.old\"])\n- Replace all entities: ha_config_set_group(\"lights\", entities=[\"light.new1\", \"light.new2\"])\n\n**NOTE:** entities, add_entities, and remove_entities are mutually exclusive.", |
1279 | 1279 | "inputSchema": { |
1280 | 1280 | "properties": { |
1281 | 1281 | "object_id": { |
|
1640 | 1640 | "source_file": "tools_config_helpers.py" |
1641 | 1641 | }, |
1642 | 1642 | { |
1643 | | - "name": "ha_delete_helpers_integrations", |
1644 | | - "title": "Delete Helper or Integration", |
1645 | | - "description": "Delete a Home Assistant helper or integration config entry.\n\nCombines simple-helper websocket deletion, config-entry deletion, and\nconfig-subentry deletion under one entry point with four routing paths\ndriven by helper_type.\n\nWHEN NOT TO USE:\n- Removing only an entity (without deleting its underlying helper or\n config entry) — use `ha_remove_entity` instead.\n- YAML-configured helpers — they have no storage backend. Edit the\n YAML file and reload the relevant integration.\n\nSUPPORTED HELPER TYPES:\n- SIMPLE (12, websocket-delete): input_button, input_boolean,\n input_select, input_number, input_text, input_datetime, counter,\n timer, schedule, zone, person, tag.\n- FLOW (15, config-entry-delete via entity lookup): template, group,\n utility_meter, derivative, min_max, threshold, integration,\n statistics, trend, random, filter, tod, generic_thermostat,\n switch_as_x, generic_hygrostat.\n\nROUTING:\n- SIMPLE helper_type + bare helper_id or entity_id → websocket delete.\n- FLOW helper_type + entity_id → resolve entity_id to config_entry_id\n via entity_registry, then delete the config entry. All sub-entities\n (e.g. utility_meter tariffs) are removed together.\n- helper_type=None + entry_id → direct config entry delete (any\n integration).\n- helper_type=\"config_subentry\" + parent entry_id + subentry_id →\n delete one config subentry.\n\nEXAMPLES:\n- Delete SIMPLE button:\n ha_delete_helpers_integrations(\n target=\"my_button\", helper_type=\"input_button\", confirm=True\n )\n- Delete FLOW utility_meter (any sub-entity works):\n ha_delete_helpers_integrations(\n target=\"sensor.energy_peak\",\n helper_type=\"utility_meter\",\n confirm=True,\n )\n- Delete any integration by entry_id:\n ha_delete_helpers_integrations(\n target=\"01HXYZ...\", confirm=True\n )\n- Delete a config subentry:\n ha_delete_helpers_integrations(\n target=\"01HXYZ...\", helper_type=\"config_subentry\",\n subentry_id=\"subentry-123\", confirm=True\n )\n\n**WARNING:** Deleting a helper or integration that is referenced by\nautomations, scripts, or other integrations may cause those to fail.\nUse ha_search_entities() / ha_get_integration() to verify before\ndeletion. Cannot be undone.", |
| 1643 | + "name": "ha_remove_helpers_integrations", |
| 1644 | + "title": "Remove Helper or Integration", |
| 1645 | + "description": "Remove a Home Assistant helper or integration config entry.\n\nUnifies three backend removal mechanisms — simple-helper websocket\ndelete, config-entry delete, and config-subentry delete — behind one\nentry point with four routing paths driven by helper_type.\n\nWHEN NOT TO USE:\n- Removing only an entity (without deleting its underlying helper or\n config entry) — use `ha_remove_entity` instead.\n- YAML-configured helpers — they have no storage backend. Edit the\n YAML file and reload the relevant integration.\n\nSUPPORTED HELPER TYPES:\n- SIMPLE (12, websocket-delete): input_button, input_boolean,\n input_select, input_number, input_text, input_datetime, counter,\n timer, schedule, zone, person, tag.\n- FLOW (15, config-entry-delete via entity lookup): template, group,\n utility_meter, derivative, min_max, threshold, integration,\n statistics, trend, random, filter, tod, generic_thermostat,\n switch_as_x, generic_hygrostat.\n\nROUTING:\n- SIMPLE helper_type + bare helper_id or entity_id → websocket delete.\n- FLOW helper_type + entity_id → resolve entity_id to config_entry_id\n via entity_registry, then delete the config entry. All sub-entities\n (e.g. utility_meter tariffs) are removed together.\n- helper_type=None + entry_id → direct config entry delete (any\n integration).\n- helper_type=\"config_subentry\" + parent entry_id + subentry_id →\n delete one config subentry.\n\nMISSING-TARGET CONTRACT:\nA target that is *confirmed absent* raises a structured error\nrather than returning silent success, so a typo'd or stale\nidentifier surfaces immediately at the caller layer (the\n``success`` boolean is what agent wrappers branch on). The\nerror code per-path follows the target shape:\n- SIMPLE (bare helper_id or entity_id): state-machine empty AND\n entity registry empty → raises ``ENTITY_NOT_FOUND``.\n- FLOW (entity_id): not in entity registry → raises\n ``ENTITY_NOT_FOUND``. YAML-configured helpers (no config entry\n backing) raise ``RESOURCE_NOT_FOUND``. A bare helper_id (no\n ``.``) on a FLOW target raises ``ENTITY_NOT_FOUND`` — FLOW\n resolution needs a full entity_id. TOCTOU 404 on the\n resolved entry_id raises ``RESOURCE_NOT_FOUND``.\n- Direct config entry (helper_type=None): backend returns HTTP\n 404 → raises ``RESOURCE_NOT_FOUND``.\n- Config subentry: backend returns a \"not_found\" error → raises\n ``RESOURCE_NOT_FOUND``.\n\nIdempotency at the contract level still holds (call N times =\nsame response). Transient connectivity failures (WebSocket\ndisconnected, network timeouts) raise their own codes\n(``WEBSOCKET_DISCONNECTED``, ``CONNECTION_FAILED``) so retry\nlogic can branch separately.\n\nEXAMPLES:\n- Remove SIMPLE button:\n ha_remove_helpers_integrations(\n target=\"my_button\", helper_type=\"input_button\", confirm=True\n )\n- Remove FLOW utility_meter (any sub-entity works):\n ha_remove_helpers_integrations(\n target=\"sensor.energy_peak\",\n helper_type=\"utility_meter\",\n confirm=True,\n )\n- Remove any integration by entry_id:\n ha_remove_helpers_integrations(\n target=\"01HXYZ...\", confirm=True\n )\n- Remove a config subentry:\n ha_remove_helpers_integrations(\n target=\"01HXYZ...\", helper_type=\"config_subentry\",\n subentry_id=\"subentry-123\", confirm=True\n )\n\n**WARNING:** Removing a helper or integration that is referenced by\nautomations, scripts, or other integrations may cause those to fail.\nUse ha_search_entities() / ha_get_integration() to verify before\nremoval. Cannot be undone.", |
1646 | 1646 | "inputSchema": { |
1647 | 1647 | "properties": { |
1648 | 1648 | "target": { |
1649 | | - "type": "Annotated[str, Field(description=\"What to delete. One of: (a) bare helper_id for SIMPLE helpers (requires helper_type), e.g. 'my_button'; (b) full entity_id (requires helper_type), e.g. 'input_button.my_button' or 'sensor.my_meter'; (c) config entry_id for any integration (helper_type=None), e.g. value from ha_get_integration(); (d) parent config entry_id for config_subentry (requires helper_type='config_subentry' and subentry_id).\")]" |
| 1649 | + "type": "Annotated[str, Field(description=\"What to remove. One of: (a) bare helper_id for SIMPLE helpers (requires helper_type), e.g. 'my_button'; (b) full entity_id (requires helper_type), e.g. 'input_button.my_button' or 'sensor.my_meter'; (c) config entry_id for any integration (helper_type=None), e.g. value from ha_get_integration(); (d) parent config entry_id for config_subentry (requires helper_type='config_subentry' and subentry_id).\")]" |
1650 | 1650 | }, |
1651 | 1651 | "helper_type": { |
1652 | | - "type": "Annotated[HelperTypeLiteral | None, Field(description=\"Helper type. Required when target is a helper_id (bare) or entity_id. Set to None when target is a config entry_id to delete any integration. Use 'config_subentry' to delete a config subentry under target.\", default=None)]", |
| 1652 | + "type": "Annotated[HelperTypeLiteral | None, Field(description=\"Helper type. Required when target is a helper_id (bare) or entity_id. Set to None when target is a config entry_id to remove any integration. Use 'config_subentry' to remove a config subentry under target.\", default=None)]", |
1653 | 1653 | "default": null |
1654 | 1654 | }, |
1655 | 1655 | "subentry_id": { |
1656 | | - "type": "Annotated[str | None, Field(description=\"Config subentry ID to delete when helper_type='config_subentry'.\", default=None)]", |
| 1656 | + "type": "Annotated[str | None, Field(description=\"Config subentry ID to remove when helper_type='config_subentry'.\", default=None)]", |
1657 | 1657 | "default": null |
1658 | 1658 | }, |
1659 | 1659 | "confirm": { |
1660 | | - "type": "Annotated[bool | str, Field(description=\"Must be True to confirm deletion. Accepts bool or string ('true'/'false'/'1'/'0'/'yes'/'no'/'on'/'off', case-insensitive) for transport ergonomics.\", default=False)]", |
| 1660 | + "type": "Annotated[bool | str, Field(description=\"Must be True to confirm removal. Accepts bool or string ('true'/'false'/'1'/'0'/'yes'/'no'/'on'/'off', case-insensitive) for transport ergonomics.\", default=False)]", |
1661 | 1661 | "default": false |
1662 | 1662 | }, |
1663 | 1663 | "wait": { |
1664 | | - "type": "Annotated[bool | str, Field(description=\"Wait for entity removal. Default: True. Ignored when helper_type=None (no entity poll, require_restart returned). Accepts bool or string ('true'/'false'/'1'/'0'/'yes'/'no'/'on'/'off', case-insensitive).\", default=True)]", |
| 1664 | + "type": "Annotated[bool | str, Field(description=\"Wait for entity removal. Default: True. Ignored when helper_type=None or helper_type='config_subentry' (no entity poll, require_restart returned). Accepts bool or string ('true'/'false'/'1'/'0'/'yes'/'no'/'on'/'off', case-insensitive).\", default=True)]", |
1665 | 1665 | "default": true |
1666 | 1666 | } |
1667 | 1667 | }, |
|
1670 | 1670 | ] |
1671 | 1671 | }, |
1672 | 1672 | "annotations": { |
1673 | | - "destructiveHint": true |
| 1673 | + "destructiveHint": true, |
| 1674 | + "idempotentHint": true |
1674 | 1675 | }, |
1675 | 1676 | "tags": [ |
1676 | 1677 | "Helper Entities", |
|
0 commit comments