mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 01:08:12 +00:00
Rename description field to notes in Habitica action (#139271)
This commit is contained in:
parent
433c2cb43e
commit
9ec9110e1e
@ -39,6 +39,7 @@ ATTR_REMOVE_TAG = "remove_tag"
|
||||
ATTR_ALIAS = "alias"
|
||||
ATTR_PRIORITY = "priority"
|
||||
ATTR_COST = "cost"
|
||||
ATTR_NOTES = "notes"
|
||||
|
||||
SERVICE_CAST_SKILL = "cast_skill"
|
||||
SERVICE_START_QUEST = "start_quest"
|
||||
|
@ -22,7 +22,7 @@ from habiticalib import (
|
||||
)
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.todo import ATTR_DESCRIPTION, ATTR_RENAME
|
||||
from homeassistant.components.todo import ATTR_RENAME
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.const import ATTR_NAME, CONF_NAME
|
||||
from homeassistant.core import (
|
||||
@ -45,6 +45,7 @@ from .const import (
|
||||
ATTR_DIRECTION,
|
||||
ATTR_ITEM,
|
||||
ATTR_KEYWORD,
|
||||
ATTR_NOTES,
|
||||
ATTR_PATH,
|
||||
ATTR_PRIORITY,
|
||||
ATTR_REMOVE_TAG,
|
||||
@ -116,7 +117,7 @@ SERVICE_UPDATE_TASK_SCHEMA = vol.Schema(
|
||||
vol.Required(ATTR_CONFIG_ENTRY): ConfigEntrySelector(),
|
||||
vol.Required(ATTR_TASK): cv.string,
|
||||
vol.Optional(ATTR_RENAME): cv.string,
|
||||
vol.Optional(ATTR_DESCRIPTION): cv.string,
|
||||
vol.Optional(ATTR_NOTES): cv.string,
|
||||
vol.Optional(ATTR_TAG): vol.All(cv.ensure_list, [str]),
|
||||
vol.Optional(ATTR_REMOVE_TAG): vol.All(cv.ensure_list, [str]),
|
||||
vol.Optional(ATTR_ALIAS): vol.All(
|
||||
@ -566,8 +567,8 @@ def async_setup_services(hass: HomeAssistant) -> None: # noqa: C901
|
||||
if rename := call.data.get(ATTR_RENAME):
|
||||
data["text"] = rename
|
||||
|
||||
if (description := call.data.get(ATTR_DESCRIPTION)) is not None:
|
||||
data["notes"] = description
|
||||
if (notes := call.data.get(ATTR_NOTES)) is not None:
|
||||
data["notes"] = notes
|
||||
|
||||
tags = cast(list[str], call.data.get(ATTR_TAG))
|
||||
remove_tags = cast(list[str], call.data.get(ATTR_REMOVE_TAG))
|
||||
|
@ -147,7 +147,7 @@ update_reward:
|
||||
rename:
|
||||
selector:
|
||||
text:
|
||||
description:
|
||||
notes:
|
||||
required: false
|
||||
selector:
|
||||
text:
|
||||
|
@ -12,8 +12,8 @@
|
||||
"task_description": "The name (or task ID) of the task you want to update.",
|
||||
"rename_name": "Rename",
|
||||
"rename_description": "The new title for the Habitica task.",
|
||||
"description_name": "Update description",
|
||||
"description_description": "The new description for the Habitica task.",
|
||||
"notes_name": "Update notes",
|
||||
"notes_description": "The new notes for the Habitica task.",
|
||||
"tag_name": "Add tags",
|
||||
"tag_description": "Add tags to the Habitica task. If a tag does not already exist, a new one will be created.",
|
||||
"remove_tag_name": "Remove tags",
|
||||
@ -690,9 +690,9 @@
|
||||
"name": "[%key:component::habitica::common::rename_name%]",
|
||||
"description": "[%key:component::habitica::common::rename_description%]"
|
||||
},
|
||||
"description": {
|
||||
"name": "[%key:component::habitica::common::description_name%]",
|
||||
"description": "[%key:component::habitica::common::description_description%]"
|
||||
"notes": {
|
||||
"name": "[%key:component::habitica::common::notes_name%]",
|
||||
"description": "[%key:component::habitica::common::notes_description%]"
|
||||
},
|
||||
"tag": {
|
||||
"name": "[%key:component::habitica::common::tag_name%]",
|
||||
|
@ -17,6 +17,7 @@ from homeassistant.components.habitica.const import (
|
||||
ATTR_DIRECTION,
|
||||
ATTR_ITEM,
|
||||
ATTR_KEYWORD,
|
||||
ATTR_NOTES,
|
||||
ATTR_PRIORITY,
|
||||
ATTR_REMOVE_TAG,
|
||||
ATTR_SKILL,
|
||||
@ -38,7 +39,7 @@ from homeassistant.components.habitica.const import (
|
||||
SERVICE_TRANSFORMATION,
|
||||
SERVICE_UPDATE_REWARD,
|
||||
)
|
||||
from homeassistant.components.todo import ATTR_DESCRIPTION, ATTR_RENAME
|
||||
from homeassistant.components.todo import ATTR_RENAME
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
|
||||
@ -984,9 +985,9 @@ async def test_task_not_found(
|
||||
),
|
||||
(
|
||||
{
|
||||
ATTR_DESCRIPTION: "DESCRIPTION",
|
||||
ATTR_NOTES: "NOTES",
|
||||
},
|
||||
Task(notes="DESCRIPTION"),
|
||||
Task(notes="NOTES"),
|
||||
),
|
||||
(
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user