stefan2904 / todoist2mqtt

Publish Todoist webhook-events to MQTT
MIT License
2 stars 0 forks source link

Switch to `todoist-api-python` #1

Open stefan2904 opened 1 year ago

stefan2904 commented 1 year ago

As todoist-python is deprecated, we need to switch to todoist-api-python.

stefan2904 commented 1 year ago

(Unfortunately this is a rather annoying move from Todoist. Since I am not really using Todoist anymore, I don't have the time to fix this right now. As a "quick-fix" I am going to remove existing Todoist integrations from my system for now.)

stefan2904 commented 1 year ago

For the record, the currently used library/version results in error like this:

[2022-12-19 11:50:53,383] ERROR in app: Exception on /test [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/src/app/app.py", line 89, in test
    process_event('testevent', {'id': '3697787544'})
  File "/usr/src/app/app.py", line 59, in process_event
    item = todoist_api.items.get(event['id'])
  File "/usr/local/lib/python3.7/site-packages/todoist/managers/items.py", line 191, in get
    if obj.get("project"):
AttributeError: 'str' object has no attribute 'get'