From 53f50fe99fb0fe887c36ca07c354384576d58b8f Mon Sep 17 00:00:00 2001 From: Luke Date: Sun, 5 Oct 2025 20:57:53 -0400 Subject: [PATCH] fix: cli on windows --- roborock/cli.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roborock/cli.py b/roborock/cli.py index d625737a..2a7ac2ed 100644 --- a/roborock/cli.py +++ b/roborock/cli.py @@ -27,6 +27,7 @@ import functools import json import logging +import sys import threading from collections.abc import Callable from dataclasses import asdict, dataclass @@ -55,6 +56,9 @@ _LOGGER = logging.getLogger(__name__) +if sys.platform == "win32": + asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) + def dump_json(obj: Any) -> Any: """Dump an object as JSON."""