lib/sonos/discovery.rb
# Find all of the Sonos devices on the network
# @return [Array] an array of TopologyNode objects
Find all of the Sonos devices on the network
Find all of the Sonos devices on the network
def topology
      self.discover unless @first_device_ip
      return [] unless @first_device_ip
      doc = Nokogiri::XML(open("http://#{@first_device_ip}:#{Sonos::PORT}/status/topology"))
      doc.xpath('//ZonePlayers/ZonePlayer').map do |node|
        TopologyNode.new(node)
      end
    end
def topology self . discover unless @first_device_ip return [ ] unless @first_device_ip doc = Nokogiri :: XML ( open ( "http://#{@first_device_ip}:#{Sonos::PORT}/status/topology" ) ) doc . xpath ( '//ZonePlayers/ZonePlayer' ) . map do | node | TopologyNode . new ( node ) end end
Find all of the Sonos devices on the network
Find all of the Sonos devices on the network
an array of TopologyNode objects
an array of TopologyNode objects
Array