class WemoDevice::Device
Public Class Methods
lookup()
click to toggle source
# File lib/wemo_device/device.rb, line 8 def lookup # Wemo devices are responding only when search target is the URN. # `ssdp:all` and other search target doesn't work. SSDP.new.lookup(URN, 3).select do |response| # There are many devices that ignores `ST`, like Philips Hue. response.search_target == URN end.map do |response| Device.new(response) end end
new(response)
click to toggle source
# File lib/wemo_device/device.rb, line 20 def initialize(response) @response = response end
Public Instance Methods
description()
click to toggle source
# File lib/wemo_device/device.rb, line 32 def description @description ||= Description.new(@response.location) end
location()
click to toggle source
# File lib/wemo_device/device.rb, line 28 def location @response.location end
unique_service_name()
click to toggle source
# File lib/wemo_device/device.rb, line 24 def unique_service_name @response.unique_service_name end