feat(cli): add set command group for equipment control#146
Open
tonyfruzza wants to merge 1 commit into
Open
Conversation
Add a new 'set' command group to the CLI that exposes equipment control operations that were previously only available through the Python API: - set heater-temp <system_id> <temperature> — Set heater target temp (°F) - set solar-temp <system_id> <temperature> — Set solar heater target (°F) - set speed <system_id> <percent> — Set pump/filter speed (0-100%) - set on <system_id> — Turn equipment on - set off <system_id> — Turn equipment off This allows scripting and automation of pool control without writing Python code, complementing the existing read-only 'get' and 'debug' command groups. Resolves cryptk#145
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds a new
setcommand group to the CLI exposing equipment control operations that were previously only available through the Python library API.Closes #145
New CLI commands
Motivation
The library has comprehensive control methods (
heater.set_temperature(),pump.set_speed(),light.turn_on(), etc.) but the CLI only exposed read-only operations viagetanddebug. This made it impossible to control equipment from shell scripts, cron jobs, or lightweight HTTP wrappers without writing Python.Implementation
pyomnilogic_local/cli/set/module following the same pattern ascli/get/OmniLogicinstance from Click context (already initialized by entrypoint)all_heaters.get_by_id(),all_pumps.get_by_id(),all_filters.get_by_id(), andget_equipment_by_id()for generic on/offasyncio.run()for async calls, mypy error suppression for Click decoratorsFiles changed
cli/cli.pysetcommand groupcli/set/__init__.pycli/set/commands.pycli/set/heater_temp.pyheater-tempandsolar-tempcommandscli/set/speed.pyspeedcommand for pumps/filterscli/set/equipment.pyon/offcommandsTesting
I have been testing these control operations against a live Hayward OmniLogic controller (firmware 5.1.85) via an HTTP wrapper that uses the same library methods. Temperature set-points, pump speed, and on/off all confirmed working.
Note: I do not have the test harness set up locally (missing pydantic/dev dependencies) so I have not run the existing test suite. Happy to add unit tests if desired — would follow the mock-based pattern in
tests/.