From 698359621d1131c9a2734dd2cf53d1ffe75a5900 Mon Sep 17 00:00:00 2001 From: Jonathan Keljo Date: Sun, 18 Feb 2024 15:31:28 -0800 Subject: [PATCH] Make pyright happy --- greeneye/monitor.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/greeneye/monitor.py b/greeneye/monitor.py index b35a159..47daf38 100644 --- a/greeneye/monitor.py +++ b/greeneye/monitor.py @@ -558,7 +558,8 @@ async def _configure_from_settings( LOG.info(f"Configured {self.serial_number} from settings API call.") for listener in self._listeners: - coroutines.append(_ensure_coroutine(listener)()) + coroutine: Callable[[], Awaitable[None]] = _ensure_coroutine(listener) + coroutines.append(coroutine()) await asyncio.gather(*coroutines) async def _configure_from_packet(self, packet: Packet) -> None: @@ -622,9 +623,7 @@ async def handle_packet(self, packet: Packet) -> None: async def _invoke_listeners(listeners: List[Listener]) -> None: - coroutines: list[Awaitable[None]] = [ - _ensure_coroutine(listener)() for listener in listeners - ] + coroutines = [_ensure_coroutine(listener)() for listener in listeners] if len(coroutines) > 0: await asyncio.gather(*coroutines)