Support todoist task description in new_task service (#116203)

This commit is contained in:
David Symonds 2024-06-22 20:42:46 +10:00 committed by GitHub
parent f8c1710753
commit f258034f9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 0 deletions

View File

@ -66,6 +66,7 @@ _LOGGER = logging.getLogger(__name__)
NEW_TASK_SERVICE_SCHEMA = vol.Schema(
{
vol.Required(CONTENT): cv.string,
vol.Optional(DESCRIPTION): cv.string,
vol.Optional(PROJECT_NAME, default="inbox"): vol.All(cv.string, vol.Lower),
vol.Optional(LABELS): cv.ensure_list_csv,
vol.Optional(ASSIGNEE): cv.string,
@ -225,6 +226,8 @@ def async_register_services(
content = call.data[CONTENT]
data: dict[str, Any] = {"project_id": project_id}
if description := call.data.get(DESCRIPTION):
data["description"] = description
if task_labels := call.data.get(LABELS):
data["labels"] = task_labels

View File

@ -5,6 +5,9 @@ new_task:
example: Pick up the mail.
selector:
text:
description:
selector:
text:
project:
example: Errands
default: Inbox

View File

@ -29,6 +29,10 @@
"name": "Content",
"description": "The name of the task."
},
"description": {
"name": "Description",
"description": "A description for the task."
},
"project": {
"name": "Project",
"description": "The name of the project this task should belong to."