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

[FEATURE REQUEST] #32

Open
arretx opened this issue Jan 20, 2023 · 9 comments
Open

[FEATURE REQUEST] #32

arretx opened this issue Jan 20, 2023 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@arretx
Copy link

arretx commented Jan 20, 2023

In the todoist-card.js file, at line 443, it appears that this is where the check for only today or overdue status is checked and filtered. I'm not a js expert (actually beginner) so I'm trying to figure out the logic here in order to solve the problem I have.

Problem: I need to be able to create a card that lists tasks that are due two days, three days, or even a week out. At the bare minimum, to be able to have two cards, one for tasks due today and one for tasks scheduled to be due tomorrow.

My experience is this: If I don't filter out tasks that are due today or past due, then I end up with a card jammed with every task in the project, when I only want to see today's outlook. So, if a task is due today, that's great, but if I'm creating a task today that's scheduled to be done tomorrow, I won't see that task on the card until midnight instead of having a card that shows "Tomorrow's Tasks" etc.

Any chance of working this out?

@arretx arretx added the enhancement New feature or request label Jan 20, 2023
@sw-carlos-cristobal
Copy link

@arretx I have implemented a filtering option to select the number of days in the future to display in a card in my forked version here: #31 (https://github.com/sw-carlos-cristobal/todoist-card/releases/tag/beta-0.0.5)

@arretx
Copy link
Author

arretx commented Jan 25, 2023

Seems to be working well, but the feature I'm actually interested in is pinpointing a single day. If I do "days out" I get today and tomorrow, but if I just want to see what's on the task list for tomorrow, I can't see it without today's tasks as well.

Looks like the calculation for this is handled on 534 in your js file on your repo. Your repo doesn't have an "issues" tab so I'm responding here.

@sw-carlos-cristobal
Copy link

sw-carlos-cristobal commented Jan 25, 2023 via email

@arretx
Copy link
Author

arretx commented Jan 25, 2023

Yes, to pick a single day, or range of days so you could have a card for "Today's Focus" which would be tasks that are due today, and a "Tomorrow's Focus" which would show only tasks that are due tomorrow. Or you could show a card with "3 Day Outlook" which would show all tasks for the next three days, not including today, or the next three days with an offset index. So today is Wednesday. I could have a card that shows 3 days worth of "due" tasks starting on Friday, which would be 3 days out for a range of 3 days, so "show me all tasks that have a due date in the range "friday through Sunday""

I think I'm making sense ?

@sw-carlos-cristobal
Copy link

sw-carlos-cristobal commented Jan 25, 2023 via email

@grinstantin
Copy link
Owner

grinstantin commented Jan 26, 2023

I think this issue can be solved with the standard Todoist functionality. You can create a filter in Todoist, and then use it with the Rest API to get the list of tasks you need. To do this, you need to create a separate filter/sensor for each of your cards.

This should work:

- platform: command_line
  name: Specific Name For This List
  scan_interval: 60
  command: >
     echo "{\"items\":" $(
     curl 
     -s 
     -H 'Authorization: Bearer TODOIST_API_TOKEN'
     'https://api.todoist.com/rest/v2/tasks?project_id=TODOIST_PROJECT_ID&filter=TODOIST_FILTER_ID'
     ) "}"
  value_template: >
     {{ value_json.items[0].project_id }}
  json_attributes:
     - items

Replace TODOIST_API_TOKEN with your token, TODOIST_PROJECT_ID with ID of your project and TODOIST_FILTER_ID with ID of the filter you created in Todoist.

Please note that you won't be able to use use_quick_add option with card based on this list. Let me know if you need it, I'll update the sensor above.

Also note that you can create only 3 filters in free Todoist's tariff plan.

@sw-carlos-cristobal
Copy link

sw-carlos-cristobal commented Jan 30, 2023

Personally, I'd like to just have a singular sensor per project that I can just create one card and duplicate it over and over with different settings toggled to get unique visuals.

Here is my take on a sort of "sliding window" approach.
https://github.com/sw-carlos-cristobal/todoist-card/tree/sliding-window
https://github.com/sw-carlos-cristobal/todoist-card/releases/tag/beta-0.0.14

@grinstantin
Copy link
Owner

grinstantin commented Jan 31, 2023

Personally, I'd like to just have a singular sensor per project that I can just create one card and duplicate it over and over with different settings toggled to get unique visuals.

Here is my take on a sort of "sliding window" approach. https://github.com/sw-carlos-cristobal/todoist-card/tree/sliding-window https://github.com/sw-carlos-cristobal/todoist-card/releases/tag/beta-0.0.14

That would be nice, but on the other hand - you can't just duplicate the functionality of Todoist in a HA card.

@sw-carlos-cristobal
Copy link

Yeah I get that - but I also don't want to pay for a subscription 😁😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants