Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding power board control to cli #1171

Merged
merged 1 commit into from
Aug 19, 2022
Merged

Conversation

wtgee
Copy link
Member

@wtgee wtgee commented Aug 19, 2022

  • Adds basic reporting and the ability to change relay states.
$ pocs power --help
Usage: pocs power [OPTIONS] COMMAND [ARGS]...

  Interact with power relays.

Options:
  --host TEXT  Power monitor host address.  [default: localhost]
  --port TEXT  Power monitor port.  [default: 6564]
  --help       Show this message and exit.

Commands:
  control   Control a relay by label or relay index.
  off       Turns a relay off.
  on        Turns a relay on.
  readings  Get the readings of the relays.
  status    Get the status of the power monitor.
$ pocs power status
[RELAY_0] weather_station..... OFF
[RELAY_1] unused1............. OFF
[RELAY_2] fans................ ON
[RELAY_3] unused3............. OFF
[RELAY_4] mount............... ON
$ pocs power readings
ac_ok............... ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ [0]
weather_station..... ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ [0]
unused1............. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ [0]
fans................ ▅▅▅▁▅▆█▅▆▆▇▅▅█▅▆▅▃▆▇▅▆▅▅▆▆▆▅▆▅ [9]
unused3............. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ [0]
mount............... ▆▁▄▃▄▅▂▅▂▄▃▄▁▆▂▃▅▃▁▄▁▁▄▂▅▅▂▄█▂ [99]
$ pocs power control --relay fans --command turn_off
{'command': 'turn_off', 'relay': 'fans'}

$ # Shorter method
$ pocs power off fans
{'command': 'turn_off', 'relay': 'fans'}

$ pocs power on fans
{'command': 'turn_on', 'relay': 'fans'}

Comes from #1167

* Adds basic reporting and the ability to change relay states.
@codecov
Copy link

codecov bot commented Aug 19, 2022

Codecov Report

Merging #1171 (8cfea6b) into develop (4908119) will decrease coverage by 8.63%.
The diff coverage is 56.31%.

@@             Coverage Diff             @@
##           develop    #1171      +/-   ##
===========================================
- Coverage    83.08%   74.45%   -8.64%     
===========================================
  Files           86       91       +5     
  Lines         7425     7778     +353     
  Branches       635      864     +229     
===========================================
- Hits          6169     5791     -378     
- Misses        1083     1847     +764     
+ Partials       173      140      -33     
Impacted Files Coverage Δ
src/panoptes/pocs/camera/gphoto/remote.py 0.00% <0.00%> (-21.57%) ⬇️
...rc/panoptes/pocs/scheduler/observation/compound.py 0.00% <0.00%> (ø)
src/panoptes/pocs/sensor/power.py 40.23% <0.00%> (-1.74%) ⬇️
...rc/panoptes/pocs/state/states/default/analyzing.py 5.55% <0.00%> (-54.45%) ⬇️
src/panoptes/pocs/state/states/default/tracking.py 6.66% <0.00%> (-76.67%) ⬇️
src/panoptes/pocs/utils/cli/main.py 0.00% <0.00%> (-70.00%) ⬇️
src/panoptes/pocs/utils/database.py 0.00% <0.00%> (ø)
src/panoptes/pocs/utils/error.py 0.00% <0.00%> (ø)
src/panoptes/pocs/utils/logger.py 100.00% <ø> (ø)
tests/test_ioptron.py 66.66% <0.00%> (+0.70%) ⬆️
... and 70 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@wtgee wtgee merged commit b321084 into panoptes:develop Aug 19, 2022
@wtgee wtgee deleted the add-power-cli branch August 19, 2022 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant