Skip to content

Fix the todoist integration#27273

Merged
balloob merged 5 commits into
home-assistant:devfrom
boralyl:fix-todoist
Oct 7, 2019
Merged

Fix the todoist integration#27273
balloob merged 5 commits into
home-assistant:devfrom
boralyl:fix-todoist

Conversation

@boralyl
Copy link
Copy Markdown
Contributor

@boralyl boralyl commented Oct 7, 2019

Description:

This fixes the todoist integration as mentioned in the forums. When v8.0.0 of the python library was released, the api changes were backwards-incompatible. This caused the current integration to fail to parse any data since the release.

The main change is the due parameter is now an object rather than having separate due_* properties. See the changelog.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

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. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@@ -206,7 +209,7 @@ def handle_new_task(call):
project_id = project_id_lookup[project_name]

# Create the task
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This call now requires a kwarg.

@@ -216,11 +219,12 @@ def handle_new_task(call):
if PRIORITY in call.data:
item.update(priority=call.data[PRIORITY])

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the primary change to get things working with the latest version. The due parameter is now an object

else:
self._project_id_whitelist = []

def _parse_due_date(self, data: dict) -> datetime:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Dates can be in 3 formats:
'2019-10-01'
'2019-10-01T12:00:00'
'2019-10-01T12:00:00Z'

@boralyl boralyl marked this pull request as ready for review October 7, 2019 02:38
@frenck
Copy link
Copy Markdown
Member

frenck commented Oct 7, 2019

Thank you for your contribution thus far! 🎖 Since this is a significant contribution, we would appreciate you'd added yourself to the list of code owners for this integration. ❤️

Please, add your GitHub username to the manifest.json of this integration.

For more information about "code owners", see: Architecture Decision Record 0008: Code owners.

@MartinHjelmare MartinHjelmare changed the title Fixed the todoist integration. Fix the todoist integration Oct 7, 2019
Copy link
Copy Markdown
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks.

Because it fixes a current broken integration, I will go ahead and tag this for 0.100. It will be available in beta today, released on Wednesday 🎉

@balloob balloob added this to the 0.100 milestone Oct 7, 2019
@balloob balloob merged commit feb1986 into home-assistant:dev Oct 7, 2019
balloob pushed a commit that referenced this pull request Oct 8, 2019
* Fixed the todoist integration.

* Removing unused import

* Flake8 fixes.

* Added username to codeowners.

* Updated global codeowners
@lock lock Bot locked and limited conversation to collaborators Oct 8, 2019
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.

4 participants