Skip to content

Commit e6d7827

Browse files
committed
Guard for coroutine tasks
1 parent 92b8345 commit e6d7827

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugwise_usb/nodes/sed.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Task,
1010
gather,
1111
get_running_loop,
12+
iscoroutine,
1213
wait_for,
1314
)
1415
from collections.abc import Awaitable, Callable, Coroutine
@@ -663,9 +664,9 @@ async def schedule_task_when_awake(
663664
self, task_fn: Coroutine[Any, Any, bool]
664665
) -> None:
665666
"""Add task to queue to be executed when node is awake."""
666-
_LOGGER.debug("HOI tasktype: %s", type(task_fn))
667-
async with self._send_task_lock:
668-
self._send_task_queue.append(task_fn)
667+
if iscoroutine(task_fn):
668+
async with self._send_task_lock:
669+
self._send_task_queue.append(task_fn)
669670

670671
async def sed_configure( # pylint: disable=too-many-arguments
671672
self,

0 commit comments

Comments
 (0)