From e9893b97f9934404defbf43bd856802748474e7e Mon Sep 17 00:00:00 2001 From: Jeroen Dekkers Date: Sun, 21 Jun 2026 21:40:15 +0200 Subject: [PATCH] Add entrypoint for the aiocomfoconnect cli --- aiocomfoconnect/__main__.py | 7 ++++++- pyproject.toml | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/aiocomfoconnect/__main__.py b/aiocomfoconnect/__main__.py index 899ae67..ebb26d1 100644 --- a/aiocomfoconnect/__main__.py +++ b/aiocomfoconnect/__main__.py @@ -389,7 +389,8 @@ async def run_set_flow_for_speed(host: str, uuid: str, speed: Literal["away", "l await comfoconnect.disconnect() -if __name__ == "__main__": +def main_cli(): + """Parse arguments and start async event loop.""" parser = argparse.ArgumentParser() parser.add_argument("--debug", "-d", help="Enable debug logging", default=False, action="store_true") subparsers = parser.add_subparsers(required=True, dest="action") @@ -472,3 +473,7 @@ async def run_set_flow_for_speed(host: str, uuid: str, speed: Literal["away", "l asyncio.run(main(arguments), debug=True) except KeyboardInterrupt: pass + + +if __name__ == "__main__": + main_cli() diff --git a/pyproject.toml b/pyproject.toml index 77ff570..18ed2ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,9 @@ authors = ["Michaƫl Arnauts "] readme = "README.md" homepage = "https://github.com/michaelarnauts/aiocomfoconnect" +[tool.poetry.scripts] +aiocomfoconnect = "aiocomfoconnect.__main__:main_cli" + [tool.poetry.dependencies] python = "^3.10" aiohttp = "^3.8.0"