File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
homeassistant/components/google_tasks
tests/components/google_tasks Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,9 @@ def _convert_api_item(item: dict[str, str]) -> TodoItem:
5353 # Due dates are returned always in UTC so we only need to
5454 # parse the date portion which will be interpreted as a a local date.
5555 due = datetime .fromisoformat (due_str ).date ()
56+ completed : datetime | None = None
57+ if (completed_str := item .get ("completed" )) is not None :
58+ completed = datetime .fromisoformat (completed_str )
5659 return TodoItem (
5760 summary = item ["title" ],
5861 uid = item ["id" ],
@@ -61,6 +64,7 @@ def _convert_api_item(item: dict[str, str]) -> TodoItem:
6164 TodoItemStatus .NEEDS_ACTION ,
6265 ),
6366 due = due ,
67+ completed = completed ,
6468 description = item .get ("notes" ),
6569 )
6670
Original file line number Diff line number Diff line change @@ -222,13 +222,16 @@ def setup_http_response(mock_http_response: Mock) -> None:
222222 "status" : "needsAction" ,
223223 "position" : "0000000000000001" ,
224224 "due" : "2023-11-18T00:00:00Z" ,
225+ "updated" : "2023-11-10T23:00:00.333Z" ,
225226 },
226227 {
227228 "id" : "task-2" ,
228229 "title" : "Task 2" ,
229230 "status" : "completed" ,
230231 "position" : "0000000000000002" ,
231232 "notes" : "long description" ,
233+ "updated" : "2023-11-12T12:31:04.132Z" ,
234+ "completed" : "2023-11-12T12:31:04.132Z" ,
232235 },
233236 ],
234237 },
@@ -262,6 +265,7 @@ async def test_get_items(
262265 "uid" : "task-2" ,
263266 "summary" : "Task 2" ,
264267 "status" : "completed" ,
268+ "completed" : "2023-11-12T12:31:04.132000+00:00" ,
265269 "description" : "long description" ,
266270 },
267271 ]
You can’t perform that action at this time.
0 commit comments