Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pyomnilogic_local/cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import asyncio
import logging

import click

Expand All @@ -14,7 +15,8 @@
@click.option("--host", default="127.0.0.1", help="Hostname or IP address of OmniLogic system (default: 127.0.0.1)")
@click.option("--port", default=10444, help="Port number of OmniLogic system (default: 10444)")
@click.option("--timeout", default=5, help="Timeout duration for connecting to OmniLogic system in seconds (default: 5)")
def entrypoint(ctx: click.Context, host: str, port: int, timeout: int) -> None:
@click.option("--debug", is_flag=True, default=False, help="Enable debug logging")
def entrypoint(ctx: click.Context, host: str, port: int, timeout: int, debug: bool) -> None:
"""OmniLogic Local Control - Command line interface for Hayward pool controllers.

This CLI provides local control and monitoring of Hayward OmniLogic and OmniHub
Expand All @@ -37,6 +39,9 @@ def entrypoint(ctx: click.Context, host: str, port: int, timeout: int) -> None:
"""
ctx.ensure_object(dict)

if debug:
logging.basicConfig(level=logging.DEBUG)

# Store the host for later connection, but don't connect yet
ctx.obj["HOST"] = host
ctx.obj["PORT"] = port
Expand Down
1 change: 1 addition & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ in
nodejs
python314
uv
jq
];

runScript = "bash --rcfile ${shellInit}";
Expand Down
Loading