Open ndfred opened 7 years ago
+1. Automated restarting of airsonos when groupings change would be excellent.
My first "solution" to this issue was to use Screens app on my iPhone to remote into my Macbook Pro, which I run as a server to host things like AirSonos. Once in my Macbook, I Ctrl-C the existing airsonos instance running in terminal and start again.
The next step was to use SSH instead of Screens. I could run airsonos from the SSH app.But as soon as I closed the iPhone app, airsonos would stop running. My "hack" to get around this is pretty simple:
If I do this, airsonos remains running. When I change groupings, I remote back into the server, reattach to the screen (screen -r). Ctrl-C the existing airsonos instance, run airsonos again, disconnect from screen, and go one with my day.
I can think of two ways this could be easier:
npm restart airsonos
But that gave me an error and had no effect.That's pretty much what I do as well, easiest would really be to detect group changes and re-configure accordingly
This is a good idea (if it's possible!). For now, my solution is to use the "Workflow" app on iOS to run this script over SSH:
ps aux | grep airsonos | grep -v grep | awk '{print "BEFORE\nid:",$2"\nCPU:",$3"%\nSince:",$9}'
killall node
airsonos > /dev/null 2>&1 &
echo ""
ps aux | grep airsonos | grep -v grep | awk '{print "AFTER\nid:",$2"\nCPU:",$3"%\nSince:",$9}'
exit
If I start AirSonos, then group speakers I will still see two speakers in the AirPlay list. If I group speakers, then start AirSonos I will see only one speaker, but it will be named after the speaker I started the group with rather than the name of the group.
If possible it would be nice to detect grouping / un-grouping events and update the list of AirPlay speakers as a consequence. Naming grouped speakers correctly would be a nice addition too.