From c840723471fa3b21681417a4fb4d41d771fd17ea Mon Sep 17 00:00:00 2001 From: Chris Jowett <421501+cryptk@users.noreply.github.com> Date: Fri, 8 May 2026 20:34:10 +0000 Subject: [PATCH] feat(cli): add debug command to get filter diagnostics --- pyomnilogic_local/cli/debug/commands.py | 20 ++++++++++++++++++++ pyomnilogic_local/omnitypes.py | 1 + 2 files changed, 21 insertions(+) diff --git a/pyomnilogic_local/cli/debug/commands.py b/pyomnilogic_local/cli/debug/commands.py index d65d57c..b21c53f 100644 --- a/pyomnilogic_local/cli/debug/commands.py +++ b/pyomnilogic_local/cli/debug/commands.py @@ -71,6 +71,26 @@ def get_telemetry(ctx: click.Context) -> None: click.echo(telemetry) +@debug.command() +@click.argument("bow_id", type=int) +@click.argument("equip_id", type=int) +@click.pass_context +def get_filter_diagnostics(ctx: click.Context, bow_id: int, equip_id: int) -> None: + """Retrieve current filter diagnostics from the controller. + + Filter diagnostics include real-time sensor readings, equipment states, temperatures, + and other operational data. Use --raw to see the unprocessed XML. + + Example: + omnilogic debug get-filter-diagnostics + omnilogic debug --raw get-filter-diagnostics + + """ + omnilogic: OmniLogic = ctx.obj["OMNILOGIC"] + telemetry = asyncio.run(omnilogic._api.async_get_filter_diagnostics(pool_id=bow_id, equipment_id=equip_id, raw=ctx.obj["RAW"])) + click.echo(telemetry) + + @debug.command() @click.argument("pcap_file", type=click.Path(exists=True, path_type=Path)) def parse_pcap(pcap_file: Path) -> None: diff --git a/pyomnilogic_local/omnitypes.py b/pyomnilogic_local/omnitypes.py index 310a81c..d9c1518 100644 --- a/pyomnilogic_local/omnitypes.py +++ b/pyomnilogic_local/omnitypes.py @@ -35,6 +35,7 @@ class MessageType(PrettyEnum, IntEnum): MSP_CONFIGURATIONUPDATE = 1003 MSP_TELEMETRY_UPDATE = 1004 MSP_ALARM_LIST_RESPONSE = 1304 + MSP_FILTER_DIAGNOSTIC_INFO_RESPONSE = 1386 MSP_LEADMESSAGE = 1998 MSP_BLOCKMESSAGE = 1999