Class: HackyHAL::DeviceResolvers::SSDP
- Defined in:
- lib/hacky_hal/device_resolvers/ssdp.rb
Instance Attribute Summary
Attributes included from Options
Instance Method Summary collapse
-
#initialize(options) ⇒ SSDP
constructor
A new instance of SSDP.
- #uri ⇒ Object
Methods included from Options
Constructor Details
#initialize(options) ⇒ SSDP
Returns a new instance of SSDP.
14 15 16 17 |
# File 'lib/hacky_hal/device_resolvers/ssdp.rb', line 14 def initialize() super(DEFAULT_OPTIONS.merge()) ensure_option(:usn) end |
Instance Method Details
#uri ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/hacky_hal/device_resolvers/ssdp.rb', line 19 def uri @uri ||= ( old_upnp_log_value = UPnP.log? UPnP.log = false device = UPnP::SSDP.search([:search]).find do |device| device[:usn] == [:usn] end UPnP.log = old_upnp_log_value raise SsdpUnresolvedDevice unless device URI.parse(device[:location]) ) end |