diff --git a/homeassistant/components/habitica/const.py b/homeassistant/components/habitica/const.py index 5e18477d142..353bcbbd39d 100644 --- a/homeassistant/components/habitica/const.py +++ b/homeassistant/components/habitica/const.py @@ -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" diff --git a/homeassistant/components/habitica/services.py b/homeassistant/components/habitica/services.py index 16bbeef9073..57005cf2b72 100644 --- a/homeassistant/components/habitica/services.py +++ b/homeassistant/components/habitica/services.py @@ -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)) diff --git a/homeassistant/components/habitica/services.yaml b/homeassistant/components/habitica/services.yaml index b8479c1eeec..7b486690ef5 100644 --- a/homeassistant/components/habitica/services.yaml +++ b/homeassistant/components/habitica/services.yaml @@ -147,7 +147,7 @@ update_reward: rename: selector: text: - description: + notes: required: false selector: text: diff --git a/homeassistant/components/habitica/strings.json b/homeassistant/components/habitica/strings.json index 75558cea078..1bb2fcbd9d7 100644 --- a/homeassistant/components/habitica/strings.json +++ b/homeassistant/components/habitica/strings.json @@ -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%]", diff --git a/tests/components/habitica/test_services.py b/tests/components/habitica/test_services.py index 3f7ca14220b..a4442016784 100644 --- a/tests/components/habitica/test_services.py +++ b/tests/components/habitica/test_services.py @@ -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"), ), ( {