-
Notifications
You must be signed in to change notification settings - Fork 2
Direction of the SonosKeyController #2
Comments
Hi Patrick: Thanks for your questions/ideas. Interesting thoughts. As you note, my target use case for SonosKeyController is headless operation: I use it with an IR receiver device that acts like a keyboard, but it could be used with any keyboard-like device, of course. I hadn't envisaged it being used as a REPL, which is why it uses static configuration, etc. I don't currently have any plans to extend it for the REPL use case, although I could easily extend it to add As for SoCo-CLI, its primary target is automation rather than interactive use, but I have to admit that I use it a lot straight from the command line because it's often faster than switching to the Sonos apps. There are ways to reduce typing: the current version now allows partial speaker name matches, so I can type However, I have been wondering whether I could enhance SoCo-CLI with a REPL-style mode of operation. No firm plans at the moment, though. -- Peter |
Thanks Peter, Appreciate the comment. The feature I missed most in the Sonos app is just adding URL's to play / queue etc Then the issue arrises that just like you said, it's faster to just run a command on the CLI than get the Sonos app whenever I'm on any laptop. I now have SonosKeyController running in a terminal window and that is by far the fastest way to interact with the Sonos, especially using a 1 key interaction. I'm not experienced in Python, however here are some of the changes I made to provide me the things I needed in a 1 key app: Config: I have not fully tested the changes as I already had a Queue and was playing music, so everything functioned as expected. Hopefully you can work with this if you find it useful. Thank you, |
Thanks Patrick! I'll take a look later. I've just added the following to SoCo-CLI to save a bit of typing. It'll be in the next version. Using the
|
Cool! That will definitely come in handy :) |
Thanks for your code examples. I've pushed a couple of simple commits that add the ability to list and play from the queue, and to list and play from favourites. |
Thanks, after some trouble merging/rebasing the changes I decided to start over in a new branch with my customizations to make future merges from your code easier. Based on your changes and adding soco-cli, I've added a quick seek forwards and backwards feature that hopefully you find helpful as well, see all changes here: The person I showed this script to today was impressed with the ease and speed I could control their Sonos device with just a button on the keyboard instead of the battery draining Sonos official app :) |
Yes, sorry about that!
Looks good. It's a little slow to invoke soco-cli once per command, but it's also very convenient for the time being because SoCo-CLI adds lots of simplifying value on top of the SoCo library. I'll think about how to add something more akin to an API.
It can be convenient, I agree. Inspired by this discussion, I'm playing with adding a simple interactive mode to SoCo-CLI. Very early days, but if it looks promising, I may add the ability to define shortcuts in a separate file, which could then be invoked with something like Draft docs at: |
Works perfectly on my end and looks very much like what I was thinking about before I found this project :) Also like the idea of the shortcuts, now I'm getting used to single key presses to control my Sonos haha. Had some ideas for the interactive mode:
^ let me know if you like that idea, from the code I could see the actions are only specified with details in the README, however I am more than willing to help to translate this into the help/command idea if you have an idea for a framework to put this in.
If easier, we can also close this issue topic and continue a new one on soco-cli in order to keep the right context. |
Thanks for all the ideas!
Sounds good. I've started a topic over at the SoCo-CLI discussions area at: avantrec/soco-cli#10. It links back to this issue, which I'll now close. |
I've now added an API layer to SoC-CLI, and I've made a quick first pass at converting SonosKeyController to use it. It's a lot more efficient than invoking via subprocess. |
Note that there's a small change in the api.run_command() interface coming in SoCo-CLI 0.3.1, which will require a small change in clients. |
Hi @pwt,
Today I was thinking about an idea similar to this repo you created, where you have a REPL sort of interface to control the Sonos at your home.
This after using the soco-cli repo you keep updating (thanks for that as well), I found it a little repetitive to always have to fully type out all commands and not send a quick keyboard shortcut.
Could you tell me if you have ideas/plans for the future of the SonosKeyController repo?
I had some thoughts about using the Discover feature and allow the user to list which Sonos he wants to connect to, instead of having to configure it (unless of course you run it automated and don't want any interaction, it should automatically pick the one in config)
And also currently the favorites are pre configured, I was thinking maybe it is possible to get the favorites from the Sonos setup on startup? this way if someone uses the Sonos App, it will reflect on startup of the SonosKeyController more dynamically.
Is it possible to add 'q' as default in the config in order to print the current queue? This will again not help anyone that doesn't have some sort of display next to the running SonosKeyController, however for my idea running it as a REPL helps a lot.
Thank you!
The text was updated successfully, but these errors were encountered: