Skip to content

Commit

Permalink
fix: Fix todo creation to correctly accept reminder date/time
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerSelwyn committed May 7, 2024
1 parent a434a2c commit cd1fcc1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions custom_components/o365/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
ATTR_TITLE,
)
from homeassistant.const import CONF_EMAIL, CONF_ENABLED, CONF_NAME

from O365.calendar import ( # pylint: disable=no-name-in-module
AttendeeType,
EventSensitivity,
Expand Down Expand Up @@ -267,16 +266,16 @@
TODO_SERVICE_NEW_SCHEMA = {
vol.Required(ATTR_SUBJECT): cv.string,
vol.Optional(ATTR_DESCRIPTION): cv.string,
vol.Optional(ATTR_DUE): cv.string,
vol.Optional(ATTR_REMINDER): cv.datetime,
vol.Optional(ATTR_DUE): cv.date,
vol.Optional(ATTR_REMINDER): vol.Any(cv.date, cv.datetime),
}

TODO_SERVICE_UPDATE_SCHEMA = {
vol.Required(ATTR_TODO_ID): cv.string,
vol.Optional(ATTR_SUBJECT): cv.string,
vol.Optional(ATTR_DESCRIPTION): cv.string,
vol.Optional(ATTR_DUE): cv.string,
vol.Optional(ATTR_REMINDER): cv.datetime,
vol.Optional(ATTR_DUE): cv.date,
vol.Optional(ATTR_REMINDER): vol.Any(cv.date, cv.datetime),
}

TODO_SERVICE_DELETE_SCHEMA = {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/o365/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ new_todo:
due:
name: Due date
description: When the todo is due by
example: "YYYY-MM-DD"
example: '"2025-01-01"'
selector:
date:
reminder:
Expand Down
2 changes: 1 addition & 1 deletion docs/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ target:
data:
subject: Pick up the mail
description: Walk to the post box and collect the mail
due: 2023-01-01 # Note that due only takes a date, not a time
due: "2023-01-01" # Note that due only takes a date, not a datetime
reminder: 2023-01-01T12:00:00+0000
```

Expand Down

0 comments on commit cd1fcc1

Please sign in to comment.