Skip to content

Commit

Permalink
Merge pull request #209 from marcelvriend/fix/updating-overdue-tasks-…
Browse files Browse the repository at this point in the history
…sensor

Fix updating overdue tasks sensor
  • Loading branch information
isabellaalstrom authored May 9, 2022
2 parents da10edf + 1f306bd commit bbf2405
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/grocy/grocy_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ async def async_update_overdue_tasks(self):
overdue_tasks = []
for task in tasks:
if task.due_date:
now = datetime.now().replace(tzinfo=utc)
due = task.due_date.replace(tzinfo=utc)
if due < now:
current_date = datetime.now().date()
due_date = task.due_date
if due_date < current_date:
overdue_tasks.append(task)
return overdue_tasks

Expand Down

0 comments on commit bbf2405

Please sign in to comment.