mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
Support todoist task description in new_task service (#116203)
This commit is contained in:
parent
f8c1710753
commit
f258034f9c
@ -66,6 +66,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
NEW_TASK_SERVICE_SCHEMA = vol.Schema(
|
NEW_TASK_SERVICE_SCHEMA = vol.Schema(
|
||||||
{
|
{
|
||||||
vol.Required(CONTENT): cv.string,
|
vol.Required(CONTENT): cv.string,
|
||||||
|
vol.Optional(DESCRIPTION): cv.string,
|
||||||
vol.Optional(PROJECT_NAME, default="inbox"): vol.All(cv.string, vol.Lower),
|
vol.Optional(PROJECT_NAME, default="inbox"): vol.All(cv.string, vol.Lower),
|
||||||
vol.Optional(LABELS): cv.ensure_list_csv,
|
vol.Optional(LABELS): cv.ensure_list_csv,
|
||||||
vol.Optional(ASSIGNEE): cv.string,
|
vol.Optional(ASSIGNEE): cv.string,
|
||||||
@ -225,6 +226,8 @@ def async_register_services(
|
|||||||
content = call.data[CONTENT]
|
content = call.data[CONTENT]
|
||||||
data: dict[str, Any] = {"project_id": project_id}
|
data: dict[str, Any] = {"project_id": project_id}
|
||||||
|
|
||||||
|
if description := call.data.get(DESCRIPTION):
|
||||||
|
data["description"] = description
|
||||||
if task_labels := call.data.get(LABELS):
|
if task_labels := call.data.get(LABELS):
|
||||||
data["labels"] = task_labels
|
data["labels"] = task_labels
|
||||||
|
|
||||||
|
@ -5,6 +5,9 @@ new_task:
|
|||||||
example: Pick up the mail.
|
example: Pick up the mail.
|
||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
|
description:
|
||||||
|
selector:
|
||||||
|
text:
|
||||||
project:
|
project:
|
||||||
example: Errands
|
example: Errands
|
||||||
default: Inbox
|
default: Inbox
|
||||||
|
@ -29,6 +29,10 @@
|
|||||||
"name": "Content",
|
"name": "Content",
|
||||||
"description": "The name of the task."
|
"description": "The name of the task."
|
||||||
},
|
},
|
||||||
|
"description": {
|
||||||
|
"name": "Description",
|
||||||
|
"description": "A description for the task."
|
||||||
|
},
|
||||||
"project": {
|
"project": {
|
||||||
"name": "Project",
|
"name": "Project",
|
||||||
"description": "The name of the project this task should belong to."
|
"description": "The name of the project this task should belong to."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user