-
Notifications
You must be signed in to change notification settings - Fork 4
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
feature request -- cli support for all functions in the API #16
Comments
I think this sounds like a great idea. If we add this interface we would need to integrate it into some CI testing as well that is ran against a fake amplipi, in the past I have used As for presets, the load function executes the partial change of state specified by the preset. So if the
|
ok, getting started on the branch to implement including pytest is something I could surely do as well (have some experience with that -- in fact I would typically extend the Makefile hinted in #15 with a However -- against which actual service would you consider the tests to be executed? To be clear: personally I would not want to have standard tests (including clearing config) to run against my running in house amplipi - do you guys have a standard mock or docker instance one can run on localhost to do this kind of stuff? Any other advise? |
tracking my progress can be done over at --> main...marc-portier:pyamplipi:issue-16
|
… from json input and apply it to implement the announce action further progress towards brianhealey#16
While working on #16 I notice more missing features and altered models available on my local amplipi (v.0.1.9) compared to what is present in this library. This is the same observation as was raised in #7 - the pull-request made available there (#11) is waiting to get merged on some testing for possible issues with other dependent libraries and systems ? As I go along it looks like my branch for issue-16 is going to be facing the same limitations as it will be ontroducing more changes of a similar nature and possible impact. Net effect to me is to also include that previous pull-request (#11) in this ongoing work and just close it. |
- removing null values from json to produce cleaner output - introduce an interactive_confirmation for sensitive actions - and a --force to override - first stab at trying to use the new /status/load (still has errors though)
There have been a couple of changes to the API from 0.1.7 to 0.1.9, here is the full diff that github shows us: micro-nova/AmpliPi@0.1.7...0.1.9-uv-hotfix API changes will be found in |
At a quick glance here are the changes I see to the API (from appl.py):
For the json models (models.py) we added relative volume control, updated system information, and showed what stream commands were supported. Here is a little more detail:
I hope this helps! |
this allows to reuse the running client but also required extra io handling beyond the stdin/stdout all in all a bit of a side-track to the ongoing work for brianhealey#16 but lays down the ground for adding the remaining actions
thx for the explanations, @linknum23 the work is going well, and this helps completing what I am cooking up :) Concerning the fact that the "info" part of the Status is really only read-only: I was thinking to create a split up of the models into
current:
change to:
wdyt? |
That sounds great. We could even change this in the AmpliPi repo. |
creating a Config model that does noet contain the read-only part 'info' as [per agreement](brianhealey#16 (comment)) in brianhealey#16 thread
progress for brianhealey#16 completes the 'status' part of the API
completing the source api calls for brianhealey#16 this includes the get-image call (which produces binary / non-json)
further progress on brianhealey#16
further progress on brianhealey#16
fixes brianhealey#16 even if some todo remain for future work
The current
cli.py
functions as a nice introduction/example on how to use the library for very specific scripted automation needs. Actuallyexample.py
would probably be a better name, since it does not provide a full CLI coverage of all the functions provided by the library.We could however introduce such coverage via a
__main__.py
It should:
setup( entry_points={'console_scripts'= ['pyamplipi = pyamplipi.__main__:main']})
AMPLIPI_API_URL
andAMPLIPI_TIMEOUT
from the environment through.env
+python-dotenv
-a «api_url»
and-t «timeout»
argparse
to cover all of the api via some smart design of the args:note:
PATCH /api/presets/{pid}
and load-presetPOST /api/presets/{pid}/load
and how the CLI might maybe either hide or support both in the most natural wayI would be glad to provide a PR introducing the above as I see it a logical fit to what the lib is offering.
But I would also understand if you consider this as 'out of scope' and tell me to buzz off and implement this in a separate project.
The text was updated successfully, but these errors were encountered: