Repository navigation
Allow updating To Do task importance and checklist names - #1224
Open
snfx-johaver wants to merge 2 commits into
Open
snfx-johaver wants to merge 2 commits into
snfx-johaver wants to merge 2 commits into
Conversation
Track task importance and checklist display name updates through save(). Preserve omitted importance and unrelated fields, with request-level regression tests and usage examples. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
RogerSelwyn
reviewed
Nov 13, 2026
| return self.__importance | ||
|
|
||
| @importance.setter | ||
| def importance(self, value): |
Contributor
There was a problem hiding this comment.
I think this should be using an eNum for enforcing the value, there is an example in Calendar Event.
from .utils import ImportanceLevel
@importance.setter
def importance(self, value):
self.__importance = (value if isinstance(value, ImportanceLevel)
else ImportanceLevel.from_value(value))
self._track_changes.add(self._cc('importance'))
Imo
Author
There was a problem hiding this comment.
Thanks, Roger — updated to use the shared ImportanceLevel enum and its string conversion. It now accepts enum members too, while keeping the existing string getter compatible. Invalid values still raise ValueError. All 34 tests pass, including string and enum inputs for each importance level.
Auto-replied by the GitHub Copilot app
Accept enum members and shared string conversion while preserving the existing string getter and explicit invalid-value errors. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I'd like to add two writable properties to the To Do SDK:
Both use the existing change tracking. The importance setter uses the shared
ImportanceLevelenum and its string conversion, while keeping the existing string getter compatible. Invalid values raiseValueError, and unrelated saves don't send or reset importance. Renaming a checklist item doesn't change its checked state.I've added usage examples and 34 passing request-level regression tests covering string and enum inputs, creates, updates, validation, combined edits, preservation, and retry after a failed save. Run with
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest tests/test_tasks.py -q(plugin autoload is disabled to avoid an unrelated locally installed Home Assistant plugin).This unblocks RogerSelwyn/MS365-ToDo#199 once these SDK changes are merged and released. I haven't changed the package version or assumed a release number.