cryptk / cryptk/python-omnilogic-local

feat(cli): Add control commands (set temperature, on/off, speed)

Offen
#145 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
10
Forks
13
Ø Merge
5 Min.
Gemergte PRs (30 T.)
2

Beschreibung

## Summary

The CLI currently only exposes read-only commands (`get` and `debug` subgroups). The library itself fully supports equipment control via methods like `heater.set_temperature()`, `pump.set_speed()`, `light.turn_on()`, etc., but there is no way to invoke these operations from the command line.

## Motivation

Users who want to script pool control (e.g., cron jobs, home automation integrations, or wrapping the CLI in an HTTP API) currently have to write Python code using the library directly. Adding a `set` command group to the CLI would make equipment control accessible without any custom code.

### Use cases
- **Scripting**: `omnilogic --host 192.168.1.100 set heater-temp 1 4 82` to set pool heater to 82°F from a shell script
- **HTTP wrappers**: Lightweight API services that shell out to the CLI for control commands
- **Debugging/testing**: Quickly toggle equipment during development without writing async Python

## Proposed CLI interface

```
# Heater temperature control
omnilogic set heater-temp
omnilogic set solar-temp

# Equipment on/off
omnilogic set equipment-on
omnilogic set equipment-off

# Pump/filter speed
omnilogic set speed

# Light control
omnilogic set light-show [--brightness N] [--speed N]
```

## Implementation notes

- The high-level library already has all the primitives: `heater.set_temperature()`, `pump.set_speed()`, `light.turn_on()`, `light.set_show()`, etc.
- The CLI already instantiates `OmniLogic` and calls `refresh()` in the entrypoint, so adding a `set` command group would follow the same pattern as the existing `get` group.
- Equipment lookup by `bow_id`/`system_id` can use `omni.backyard.bow` and iterate equipment collections.

## Context

I ran into this gap while building a containerized HTTP API wrapper for my OmniLogic system. I ended up importing `pyomnilogic_local` directly to get temperature control since the CLI had no way to set heater temperatures. Happy to contribute a PR if this aligns with the project direction.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne am CLI-Einstiegspunkt, an dem OmniLogic instanziiert und refresh() aufgerufen wird, und vergleiche die vorgeschlagene set-Gruppe mit der bestehenden get-Gruppe. Verfolge die aufgeführten Bibliotheksprimitive und die Gerätesuche über omni.backyard.bow. Die Aufgabe ist erledigt, wenn die vorgeschlagenen Befehle für Heizung, Solar, Geräte, Geschwindigkeit und Beleuchtung die entsprechenden Steuerelemente mit den dokumentierten Argumenten aufrufen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
cli
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.