Fix google_tasks generic typing (#102778)

This commit is contained in:
Marc Mueller 2023-10-25 16:22:19 +02:00 committed by GitHub
parent b83ada8c19
commit 4cac20f835
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -16,7 +16,7 @@ UPDATE_INTERVAL: Final = datetime.timedelta(minutes=30)
TIMEOUT = 10 TIMEOUT = 10
class TaskUpdateCoordinator(DataUpdateCoordinator): class TaskUpdateCoordinator(DataUpdateCoordinator[list[dict[str, Any]]]):
"""Coordinator for fetching Google Tasks for a Task List form the API.""" """Coordinator for fetching Google Tasks for a Task List form the API."""
def __init__( def __init__(

View File

@ -58,7 +58,9 @@ async def async_setup_entry(
) )
class GoogleTaskTodoListEntity(CoordinatorEntity, TodoListEntity): class GoogleTaskTodoListEntity(
CoordinatorEntity[TaskUpdateCoordinator], TodoListEntity
):
"""A To-do List representation of the Shopping List.""" """A To-do List representation of the Shopping List."""
_attr_has_entity_name = True _attr_has_entity_name = True
@ -89,7 +91,7 @@ class GoogleTaskTodoListEntity(CoordinatorEntity, TodoListEntity):
summary=item["title"], summary=item["title"],
uid=item["id"], uid=item["id"],
status=TODO_STATUS_MAP.get( status=TODO_STATUS_MAP.get(
item.get("status"), TodoItemStatus.NEEDS_ACTION item.get("status"), TodoItemStatus.NEEDS_ACTION # type: ignore[arg-type]
), ),
) )
for item in self.coordinator.data for item in self.coordinator.data