diff --git a/custom_components/o365/const.py b/custom_components/o365/const.py index 26011d6..3d308a4 100644 --- a/custom_components/o365/const.py +++ b/custom_components/o365/const.py @@ -42,7 +42,6 @@ class EventResponse(Enum): ATTR_START = "start" ATTR_SUBJECT = "subject" ATTR_SUMMARY = "summary" -ATTR_TITLE = "title" ATTR_TYPE = "type" ATTR_ZIP_ATTACHMENTS = "zip_attachments" ATTR_ZIP_NAME = "zip_name" diff --git a/custom_components/o365/schema.py b/custom_components/o365/schema.py index fb7f602..4d94ae7 100644 --- a/custom_components/o365/schema.py +++ b/custom_components/o365/schema.py @@ -259,7 +259,7 @@ ) NEW_TASK_SCHEMA = { - vol.Required(ATTR_TITLE): cv.string, + vol.Required(ATTR_SUBJECT): cv.string, vol.Optional(ATTR_DESCRIPTION): cv.string, vol.Optional(ATTR_DUE): cv.string, vol.Optional(ATTR_REMINDER): cv.datetime, diff --git a/custom_components/o365/sensor.py b/custom_components/o365/sensor.py index 3af514a..b8e7ff9 100644 --- a/custom_components/o365/sensor.py +++ b/custom_components/o365/sensor.py @@ -20,7 +20,6 @@ ATTR_OVERDUE_TASKS, ATTR_SUBJECT, ATTR_SUMMARY, - ATTR_TITLE, CONF_ACCOUNT, CONF_ACCOUNT_NAME, CONF_BODY_CONTAINS, @@ -403,11 +402,13 @@ def extra_state_attributes(self): all_tasks = [] overdue_tasks = [] for item in self._tasks: - task = {ATTR_TITLE: item.title} + task = {ATTR_SUBJECT: item.subject} if item.due: task[ATTR_DUE] = item.due if item.due < dt.utcnow(): - overdue_tasks.append({ATTR_TITLE: item.title, ATTR_DUE: item.due}) + overdue_tasks.append( + {ATTR_SUBJECT: item.subject, ATTR_DUE: item.due} + ) all_tasks.append(task) @@ -424,9 +425,9 @@ async def async_update(self): self._tasks = list(data) - def new_task(self, title, description=None, due=None, reminder=None): + def new_task(self, subject, description=None, due=None, reminder=None): """Create a new task for this task list.""" - new_task = self._todo.new_task(title=title) + new_task = self._todo.new_task(subject=subject) if description: new_task.body = description if due: diff --git a/custom_components/o365/services.yaml b/custom_components/o365/services.yaml index 45006ae..503ec3a 100644 --- a/custom_components/o365/services.yaml +++ b/custom_components/o365/services.yaml @@ -141,8 +141,8 @@ new_task: integration: o365 domain: sensor fields: - title: - description: The title of the task + subject: + description: The subject of the task example: Pick up the mail description: description: Description of the task