airsonos
airsonos copied to clipboard
adding support for manual setup of Sonos devices
I am fairly new to node.js. This is in fact my first step into this language. So if i have missed some conventions or you have suggestions how i could make this better, just tell me, highly appreciated.
This adds the argument '--devices' to airsonos. The argument takes a comma separated list of IP addresses. airsonos tries to setup these without doing a discovery via M-SEARCH.
Usage:
node airsonos/ --devices <comma-separated list of IP[:Port]>
Example:
node airsonos/ --devices 192.168.0.100,192.168.0.101:1401
tries to setup airsonos with Sonos devices at IPs 192.168.0.100 and 192.168.0.101. While it connects to .100 over the standard port (1400), it connects to .101 over port 1401.
if a timeout occurs to one or more devices, airsonos prints an error message, but maintains connection to other devices.
@iona5 - thanks for putting this together! looks mostly good to me, with minor comments above.
Last nitpick - can you reformat using 2 spaces per indent? Keeps it inline stylistically with what it used to look like.
hi stephen,
thank you. i will update my changes accordingly.
regarding the error handling: i know what you mean, but i guess i will keep that in a separate commit: i am fairly new to node.js and i am not really sure how errors should be handled in your package. i will make a proposal and you say if you like it or not. ;)
cheers iona5
(Feel free to also add yourself as a contributor in package.json :smile:)
i tried to address all the issues.
regarding the error handling i created pull request #91 which includes this pull request.
@iona5 @stephen What it necessary to get it done?
+1 - would like to see this fixed.
at the very least a rebase seems to be required