Skip to content
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

Fix adding/updating todo items with due date in CalDAV integration #105435

Merged
merged 7 commits into from
Dec 10, 2023

Conversation

DerFlob
Copy link
Contributor

@DerFlob DerFlob commented Dec 10, 2023

Proposed change

Fixes #105246.

Before the due_datetime was manually converted to a caldav-compatible date string, when adding or updating a todo. However the method to save a new todo expects a python-native date/datetime.

Additionally, when updating an existing todo, there is a helper method to convert the date/datetime to the appropriate date string.

Tested adding and updating against Nextcloud/SabreDAV.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

Using `set_due` automatically handles converting the Python-native
date/datetime values to the correct representation required by RFC5545.
Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @DerFlob

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant home-assistant bot marked this pull request as draft December 10, 2023 09:48
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

Copy link
Contributor

@allenporter allenporter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix, appreciate it.

homeassistant/components/caldav/todo.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft December 10, 2023 15:23
@DerFlob DerFlob marked this pull request as ready for review December 10, 2023 15:53
@home-assistant home-assistant bot requested a review from allenporter December 10, 2023 15:53
Copy link
Contributor

@allenporter allenporter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good, but there are some mypy/ruff errors when running on CI. Can you take a look?

@home-assistant home-assistant bot marked this pull request as draft December 10, 2023 15:58
@DerFlob DerFlob force-pushed the bugfix/todo-caldav-due branch from 0304b35 to 85ba36a Compare December 10, 2023 16:04
@DerFlob
Copy link
Contributor Author

DerFlob commented Dec 10, 2023

The changes look good, but there are some mypy/ruff errors when running on CI. Can you take a look?

For some reason the mypy pre-commit hook on my side complains, when the # type: ignore comment is there. Which is why I had them deactivated. 😅

@DerFlob DerFlob marked this pull request as ready for review December 10, 2023 16:19
@home-assistant home-assistant bot requested a review from allenporter December 10, 2023 16:19
@allenporter
Copy link
Contributor

The changes look good, but there are some mypy/ruff errors when running on CI. Can you take a look?

For some reason the mypy pre-commit hook on my side complains, when the # type: ignore comment is there. Which is why I had them deactivated. 😅

Perhaps its a different in local mypy version compared to the one running in CI? Anyway, thanks.

@allenporter allenporter merged commit 063ac53 into home-assistant:dev Dec 10, 2023
23 checks passed
@DerFlob
Copy link
Contributor Author

DerFlob commented Dec 10, 2023

The changes look good, but there are some mypy/ruff errors when running on CI. Can you take a look?

For some reason the mypy pre-commit hook on my side complains, when the # type: ignore comment is there. Which is why I had them deactivated. 😅

Perhaps its a different in local mypy version compared to the one running in CI? Anyway, thanks.

Probably something like that. I only set up the dev env quickly yesterday.
Thank you for merging! :)

@github-actions github-actions bot locked and limited conversation to collaborators Dec 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

todo.add_item service fails on CalDAV integration with due_datetime set
3 participants