Skip to content

To-do list: add note that item can be UID #38704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions source/_integrations/todo.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,25 @@ This is a full example that returns all to-do items that have not been completed
```yaml
action: todo.get_items
target:
entity_id: todo.personal_tasks
entity_id: todo.vacation_preparation
data:
status:
- needs_action
```

This is an example response to the get items action:

```yaml
todo.vacation_preparation:
items:
- summary: Water plants
uid: 01244b28-e604-11ee-a0a4-e45f0197c057
status: needs_action
- summary: turn down heating
uid: ae993df4-e604-11ee-a0a4-e45f0197c057
status: needs_action
```

### Action `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:
Expand Down Expand Up @@ -105,14 +118,14 @@ data:

Update 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:

| Data attribute | Optional | Description | Example |
| -------------- | -------- | ----------------------------------------------------------------- | ------------------------------------------------------------ |
| `item` | no | The name/summary of the to-do item to update. | 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` |
| `due_date` | yes | The date the to-do item is expected to be completed. | 2024-04-10 |
| `due_datetime` | yes | The date and time the to-do item is expected to be completed. | 2024-04-10 23:00:00 |
| `description` | yes | A more complete description than the one provided by the summary. | Collect all necessary documents and submit the final return. |
| Data attribute | Optional | Description | Example |
| -------------- | -------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| `item` | no | The UID of the to-do item. To find the UID of an item, perform a `get_items` action on the to-do list. You can also use the name/summary of the item, but using the UID is safer. | `01244b28-e604-11ee-a0a4-e45f0197c057` or `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` |
| `due_date` | yes | The date the to-do item is expected to be completed. | 2024-04-10 |
| `due_datetime` | yes | The date and time the to-do item is expected to be completed. | 2024-04-10 23:00:00 |
| `description` | yes | A more complete description than the one provided by the summary. | Collect all necessary documents and submit the final return. |

At least one of `rename` or `status` is required. Only one of `due_date` or `due_datetime` may be specified. This is a full example that updates the status and the name of a to-do item.

Expand All @@ -130,9 +143,9 @@ data:

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:

| Data attribute | Optional | Description | Example |
| -------------- | -------- | --------------------------- | ------------------------ |
| `item` | no | The name of the to-do item. | Submit income tax return |
| Data attribute | Optional | Description | Example |
| -------------- | -------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| `item` | no | The UID of the to-do item. To find the UID of an item, perform a `get_items` action on the to-do list. You can also use the name/summary of the item, but using the UID is safer. | `01244b28-e604-11ee-a0a4-e45f0197c057` or `Submit income tax return` |

This is a full example that deletes a to-do Item with the specified name.

Expand Down