Giter VIP home page Giter VIP logo

todoist-card's Introduction

Todoist Card

hacs_badge hacs_badge hacs_badge

Todoist card for Home Assistant Lovelace UI. This card displays items from selected Todoist project.

Preview of todoist-card

Installing

HACS

This card is available in HACS (Home Assistant Community Store).

Just search for Todoist Card in HACS Frontend tab.

Manual

  1. Download todoist-card.js file from the latest release.
  2. Put todoist-card.js file into your config/www folder.
  3. Add a reference to todoist-card.js in Lovelace. There's two way to do that:
    1. Using UI: ConfigurationLovelace DashboardsResources → Click Plus button → Set Url as /local/todoist-card.js → Set Resource type as JavaScript Module.
    2. Using YAML: Add the following code to lovelace section.
      resources:
        - url: /local/todoist-card.js
          type: module
  4. Add custom:todoist-card to Lovelace UI as any other card (using either editor or YAML configuration).

Using the card

This card can be configured using Lovelace UI editor.

  1. Add the following code to configuration.yaml:
    sensor:
      - platform: rest
        name: To-do List
        method: GET
        resource: 'https://api.todoist.com/sync/v9/projects/get_data'
        params:
          token: !secret todoist_api_token
          project_id: TODOIST_PROJECT_ID
        value_template: '{{ value_json[''project''][''id''] }}'
        json_attributes:
          - project
          - items
        scan_interval: 30
    
    rest_command:
      todoist:
        method: post
        url: 'https://api.todoist.com/sync/v9/{{ url }}'
        payload: !secret todoist_api_payload
        content_type: 'application/x-www-form-urlencoded'
  2. ... and to secrets.yaml:
    todoist_api_token: TODOIST_API_TOKEN
    todoist_api_payload: token=TODOIST_API_TOKEN&{{ payload }}
  3. Replace TODOIST_API_TOKEN with your token and TODOIST_PROJECT_ID with ID of your selected Todoist project.

    You can get TODOIST_PROJECT_ID from project URL, which usually looks like this: https://todoist.com/app/project/TODOIST_PROJECT_ID

  4. Reload configs or restart Home Assistant.
  5. In Lovelace UI, click 3 dots in top left corner.
  6. Click Edit Dashboard.
  7. Click Add Card button in the bottom right corner to add a new card.
  8. Find Custom: Todoist Card in the list.
  9. Choose entity.
  10. Now you should see the preview of the card!

Typical example of using this card in YAML config would look like this:

type: 'custom:todoist-card'
entity: sensor.to_do_list
show_header: true
show_completed: 5
show_item_add: true
use_quick_add: false
show_item_close: true
show_item_delete: true
only_today_overdue: false

Here is what every option means:

Name Type Default Description
type string required custom:todoist-card
entity string required An entity_id within the sensor domain.
show_completed integer 5 Number of completed tasks shown at the end of the list (0 to disable).
show_header boolean true Show friendly name of the selected sensor in the card header.
show_item_add boolean true Show text input element for adding new items to the list.
use_quick_add boolean false Use the Quick Add implementation, available in the official Todoist clients.
show_item_close boolean true Show close/complete and uncomplete buttons.
show_item_delete boolean true Show delete buttons.
only_today_overdue boolean false Only show tasks that are overdue or due today.

Note that the completed tasks list is cleared when the page is refreshed.

Actions

  • Circle marks selected task as completed.
  • Plus "uncompletes" selected task, adding it back to the list.
  • Trash bin deletes selected task (gray one deletes it only from the list of completed items, not from Todoist archive).
  • Input adds new item to the list after pressing Enter.

License

MIT © Konstantin Grinkevich

todoist-card's People

Contributors

grinstantin avatar haclark30 avatar jamie-houston avatar wrt54g avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.