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

Command line shell interface #53

Open
whaleygeek opened this issue May 13, 2016 · 3 comments
Open

Command line shell interface #53

whaleygeek opened this issue May 13, 2016 · 3 comments

Comments

@whaleygeek
Copy link
Owner

#31 hints at what I think is a command line user interface (i.e. an "energenie shell") that can be called in from other scripts. e.g. the ability to write a simple bash script with energenie commands in it.

Things I'd like to see:

A simple command to turn a device on or off (I have a pull request that does this but it's more a copy&paste than a good example of code re-use. I won't be offended if you don't use it.)
A simple command to tell if a device is on or off. (As long as the device supports this, of course.)
I like the idea of these simple commands because they can then be composed into bigger scripts. For instance, I like the idea of giving friendly names to devices, so I could call:

turn_on downstairslight

Something would then map the 'downstairslight' to device ID 0x123 and call the appropriate code to turn on device ID 0x123.

This mapping of names to device IDs needn't be part of the pynergenie code - it could be separate as long as there were simple commands for it to call to do the actual device switching.

@whaleygeek
Copy link
Owner Author

This is partly implemented in the setup_tool.py that I am working on on the device_classes branch at the moment (to aid with the testing of all the device_classes work). It's menu driven, but it's not far off what a command line 'energenie_shell' might look like.

@whaleygeek
Copy link
Owner Author

There is some work done on this over on this fork/pull request, that might influence our thinking on a command line interface:

#25

I run the command simply as:
sudo python switch.py --name 0xABC --action on

(Where 'name' is the device ID in hex and 'action' is either 'on' or 'off'.)

@whaleygeek
Copy link
Owner Author

Also #114 and #113 would provide a way to do this outside of the process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant