From 442eb68d92c712f961d21a948c5a391494aebf96 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Mon, 8 Jan 2024 09:35:47 +0100 Subject: [PATCH] Fix asyncio.gather call (#107500) --- homeassistant/components/microsoft_face/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/microsoft_face/__init__.py b/homeassistant/components/microsoft_face/__init__.py index 6e47ad79f5b..af0567f99a1 100644 --- a/homeassistant/components/microsoft_face/__init__.py +++ b/homeassistant/components/microsoft_face/__init__.py @@ -2,8 +2,10 @@ from __future__ import annotations import asyncio +from collections.abc import Coroutine import json import logging +from typing import Any import aiohttp from aiohttp.hdrs import CONTENT_TYPE @@ -267,11 +269,11 @@ class MicrosoftFace: """Store group/person data and IDs.""" return self._store - async def update_store(self): + async def update_store(self) -> None: """Load all group/person data into local store.""" groups = await self.call_api("get", "persongroups") - remove_tasks = [] + remove_tasks: list[Coroutine[Any, Any, None]] = [] new_entities = [] for group in groups: g_id = group["personGroupId"] @@ -293,7 +295,7 @@ class MicrosoftFace: self._store[g_id][person["name"]] = person["personId"] if remove_tasks: - await asyncio.gather(remove_tasks) + await asyncio.gather(*remove_tasks) await self._component.async_add_entities(new_entities) async def call_api(self, method, function, data=None, binary=False, params=None):