Add To-do due date and description fields (#104128)
* Add To-do due date and description fields * Fix due date schema * Revert devcontainer change * Split due date and due date time * Add tests for config validation function * Add timezone converstion tests * Add local todo due date/time and description implementation * Revert configuration * Revert test changes * Add comments for the todo item field description * Rename function _validate_supported_features * Fix issues in items factory * Readability improvements * Apply suggestions from code review Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Rename CONF to ATTR usages * Simplify local time validator * Rename TodoListEntityFeature fields for setting extended fields * Remove duplicate validations * Update subscribe test * Fix local_todo tests --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
2a4a5d0a07
commit
b8cc3349be
7 changed files with 554 additions and 29 deletions
|
@ -4,6 +4,11 @@ from enum import IntFlag, StrEnum
|
|||
|
||||
DOMAIN = "todo"
|
||||
|
||||
ATTR_DUE = "due"
|
||||
ATTR_DUE_DATE = "due_date"
|
||||
ATTR_DUE_DATE_TIME = "due_date_time"
|
||||
ATTR_DESCRIPTION = "description"
|
||||
|
||||
|
||||
class TodoListEntityFeature(IntFlag):
|
||||
"""Supported features of the To-do List entity."""
|
||||
|
@ -12,6 +17,9 @@ class TodoListEntityFeature(IntFlag):
|
|||
DELETE_TODO_ITEM = 2
|
||||
UPDATE_TODO_ITEM = 4
|
||||
MOVE_TODO_ITEM = 8
|
||||
SET_DUE_DATE_ON_ITEM = 16
|
||||
SET_DUE_DATETIME_ON_ITEM = 32
|
||||
SET_DESCRIPTION_ON_ITEM = 64
|
||||
|
||||
|
||||
class TodoItemStatus(StrEnum):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue