Fix local todo list persistence for due dates #110830
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed change
Fix how local todo list handles of due dates when persisted to disk. In rfc5545, the due date field is exclusive and at midnight on the due date a task is considered overdue, equivalent to end dates on a calendar event where all day events have a duration of one day. Home Assistant is using inclusive dates for due dates so a task is not considered overdue until the next day (consistent with how APIs like Google Tasks or Todoist represent a due date)
This PR has two main changes:
(1) Handle converting between the home assistant due date format (inclusive dates) and the persisted due date format
(2) Migrate old calendar object files to the new todo format.
This is needed to prepare for handle recurring tasks correctly where only one instance of a specific task is shown at a time.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: