Add support of due date calculation for grey dailies in Habitica integration (#127923)

Fix grey dailies due date calculation
This commit is contained in:
Manu 2024-10-08 14:08:16 +02:00 committed by GitHub
parent cee7017d20
commit dd5e5323f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,6 +14,9 @@ from homeassistant.util import dt as dt_util
def next_due_date(task: dict[str, Any], last_cron: str) -> datetime.date | None:
"""Calculate due date for dailies and yesterdailies."""
if task["everyX"] == 0 or not task.get("nextDue"): # grey dailies never become due
return None
today = to_date(last_cron)
startdate = to_date(task["startDate"])
if TYPE_CHECKING: