Rename todo's services and their fields (#29611)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Robert Resch 2023-10-30 22:01:49 +01:00 committed by Franck Nijhof
parent d385a681e0
commit 82398e168f
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

View File

@ -34,24 +34,22 @@ incomplete items in the list.
Some To-do List integrations allow Home Assistant to manage the To-do Items in the list. The Some To-do List integrations allow Home Assistant to manage the To-do Items in the list. The
services provided by some To-do List entities are described below or you can read more about [Service Calls](/docs/scripts/service-calls/). services provided by some To-do List entities are described below or you can read more about [Service Calls](/docs/scripts/service-calls/).
### Service `todo.create_item` ### Service `todo.add_item`
Add a new To-do Item. A To-do list `target` is selected with a [Target Selector](/docs/blueprint/selectors/#target-selector) and the `data` payload supports the following fields: Add a new To-do Item. A To-do list `target` is selected with a [Target Selector](/docs/blueprint/selectors/#target-selector) and the `data` payload supports the following fields:
| Service data attribute | Optional | Description | Example | | Service data attribute | Optional | Description | Example |
| ---------------------- | -------- | ----------- | --------| | ---------------------- | -------- | ----------- | --------|
| `summary` | no | A short summary or subject for the To-do Item. | Submit Income Tax Return | `item` | no | the name of the to-do Item. | Submit income tax return
| `status` | yes | The overall status of the To-do Item. | `needs_action` or `completed`
This is a full example of service call in YAML: This is a full example of service call in YAML:
```yaml ```yaml
service: todo.create_item service: todo.add_item
target: target:
entity_id: todo.personal_tasks entity_id: todo.personal_tasks
data: data:
summary: "Submit Income Tax Return" item: "Submit Income Tax Return"
status: "needs_action"
``` ```
### Service `todo.update_item` ### Service `todo.update_item`
@ -60,38 +58,37 @@ Update a To-do Item. A To-do list `target` is selected with a [Target Selector](
| Service data attribute | Optional | Description | Example | | Service data attribute | Optional | Description | Example |
| ---------------------- | -------- | ----------- | --------| | ---------------------- | -------- | ----------- | --------|
| `uid` | yes | The Unique identifier of the To-do Item to update. | `bY1PVzZkni1qQQlkanTvBA` | `item` | no | The name of the to-do Item to update. | Submit income tax return
| `summary` | yes | A short summary or subject for the To-do Item. | Submit Income Tax Return | `rename` | yes | The new name of the to-do Item. | Something else
| `status` | yes | The overall status of the To-do Item. | `needs_action` or `completed` | `status` | yes | The overall status of the To-do Item. | `needs_action` or `completed`
To-do Items can be identified using either a `uid` or `summary`. This is a full example of At least one of `rename` or `status` is required. This is a full example of
a service call that updates the status of a To-do Item based on the name. a service call that updates the status and the name of a to-do Item.
```yaml ```yaml
service: todo.update_item service: todo.update_item
target: target:
entity_id: todo.personal_tasks entity_id: todo.personal_tasks
data: data:
summary: "Submit Income Tax Return" item: "Submit income tax return"
rename: "Something else"
status: "completed" status: "completed"
``` ```
### Service `todo.delete_item` ### Service `todo.remove_item`
Delete a To-do Item. A To-do list `target` is selected with a [Target Selector](/docs/blueprint/selectors/#target-selector) and the `data` payload supports the following fields: Removing a To-do Item. A to-do list `target` is selected with a [Target Selector](/docs/blueprint/selectors/#target-selector), and the `data` payload supports the following fields:
| Service data attribute | Optional | Description | Example | | Service data attribute | Optional | Description | Example |
| ---------------------- | -------- | ----------- | --------| | ---------------------- | -------- | ----------- | --------|
| `uid` | yes | The Unique identifier of the To-do Item to update. | `bY1PVzZkni1qQQlkanTvBA` | `item` | yes | The name of the to-do Item. | Submit income tax return
| `summary` | yes | A short summary or subject for the To-do Item. | Submit Income Tax Return
To-do Items can be identified using either a `uid` or `summary`. This is a full example of This is a full example of a service call that deletes a to-do Item with the specified name.
a service call that delete's a To-do Item with the specified name.
```yaml ```yaml
service: todo.delete_item service: todo.delete_item
target: target:
entity_id: todo.personal_tasks entity_id: todo.personal_tasks
data: data:
summary: "Submit Income Tax Return" item: "Submit income tax return"
``` ```