Skip to content

Commit

Permalink
#7 Implemented missing method
Browse files Browse the repository at this point in the history
  • Loading branch information
Przemysław Szafrański authored and Hantick committed Jan 7, 2025
1 parent 11ad242 commit 46c60d8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/ticktick/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"ssdp": [],
"zeroconf": [],
"integration_type": "service",
"version": "2.0.2"
}
"version": "2.0.3"
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,20 @@ def __init__(
self.startDate = startDate
self.status = status
self.timeZone = timeZone

@staticmethod
def from_dict(data: dict) -> "CheckListItem":
"""Create a CheckListItem instance from a dictionary."""

return CheckListItem(
title=data.get("title")
if data.get("title") is not None
else "Unnamed SubTask",
id=data.get("id"),
sortOrder=data.get("sortOrder"),
isAllDay=data.get("isAllDay"),
startDate=data.get("startDate"),
completedTime=data.get("completedTime"),
timeZone=data.get("timeZone"),
status=TaskStatus(data.get("status", TaskStatus.NORMAL.value)),
)

0 comments on commit 46c60d8

Please sign in to comment.