SoCo/socos — pull request #12 by KennethNielsen (2014-04-13 10:38:58+00:00)
Title: Implement set speaker by speaker number (1, 2, ..) in shell mode

I don't know if this has been discussed before but this PR implements showing the player names in the list command.

It also sorts the ips, so they always come out in the same order.

Furthermore, it adds a number to each of the speakers shown by list and stores them in a module variable `KNOWN_SPEAKERS` and makes it possible to set the speaker by this number. E.g:

``
socos> list
(1) 192.168.0.12 Kontor
(2) 192.168.0.15 Badeværelse
(3) 192.168.0.17 Køkken
(4) 192.168.0.18 Stue
socos> set 1
socos(Kontor)>
``

If there are no saved speakers, set will call list first, so it will work even if you have not called list yourself.

One possible downside to this is that the list command will become as much slower as it takes to instantiate all the speakers and ask for their info, but I think that is worth it.

Let me know what you think.