-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Add completed timestamp to TodoItem #145820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @allenporter, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
if ( | ||
original_status != TodoItemStatus.COMPLETED | ||
and status == TodoItemStatus.COMPLETED | ||
): | ||
updated_data["completed"] = dt_util.utcnow() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this appropriate to do here in the base class, or does this need to be re-implemented (or not done at all) in every todolist provider?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we should not do this here since this may be a read-only property for many implementations -- for example in the Google tasks the source of truth for this is the server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case of local todo, i think it would make sense to do it in the ical library.
We probably also want to unset the completed date when the entry changes status to not completed and some other logic like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with moving this to local_todo, but could you elaborate what role you see the ical library would play in this feature? I would have thought the integration would just set the completed
property on the Todo
item in async_update_todo_item
. I didn't see an additional role for the library there.
if ( | ||
original_status != TodoItemStatus.COMPLETED | ||
and status == TodoItemStatus.COMPLETED | ||
): | ||
updated_data["completed"] = dt_util.utcnow() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case of local todo, i think it would make sense to do it in the ical library.
We probably also want to unset the completed date when the entry changes status to not completed and some other logic like that.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Proposed change
For
todo
, track the timestamp when an item was marked completed in the TodoItem.For
local_todo
, store and retrieve this from the ical storage.Architecture: home-assistant/architecture#1178
Developer doc: home-assistant/developers.home-assistant#2683
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
.To help with the load of incoming pull requests: