easy_upnp 1.1.6 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c66af83dcc88342a62f3853bc9645da68d853efe
4
- data.tar.gz: 709d7760d76927f10218e1cc409d88881d28b6b1
3
+ metadata.gz: cd20723f9549460ebde6c951bbef4b2df0a41296
4
+ data.tar.gz: 718377c74cc753bb0e4ffdeb0d71cb9ef221ef8d
5
5
  SHA512:
6
- metadata.gz: 254d60281f8155868cc274cc367d2b1c3800384e01a4b371a43fdf1612d4cc07b58bda99f25275de66b1b1c1fb402deea785957283cff8b281498aaa9e9ef3b8
7
- data.tar.gz: b4a9f81494418c9bb837fa09efb8f5f53d7d2f35bbae1137d458ebdb22c087893ef85ca325820ce166c95f63788adbe90bd66e0d133a67ea1313c0ca9e5ea7bd
6
+ metadata.gz: 790ddf169ef51a92ec74fe61ce659bc1d0edf9cf021cb2a1e5b044caf8324fe4f97e07e2d2fc69049179e8f4927e6848b2493b0e68574cbd8b29637e08362998
7
+ data.tar.gz: a4c40f79b14bb9be533b94b18d7f5ea5f6efd209e89f5df8ee1c2ec1a9553f4a802d82430c4c7b80091c1370f973d3db3a4a74c0280b07288383dcbef008748d
data/README.md CHANGED
@@ -203,7 +203,12 @@ If you don't want to have to set up an HTTP endpoint to listen to events, you ca
203
203
 
204
204
  ```ruby
205
205
  # Parse and print the XML body of the request
206
- callback = ->(request) { puts Nokogiri::XML(request.body).to_xml }
206
+ callback = ->(state_vars) do
207
+ state_vars.map do |var, value|
208
+ puts "#{var} ==>"
209
+ puts Nokogiri::XML(value).to_xml
210
+ end
211
+ end
207
212
  manager = service.on_event(callback)
208
213
 
209
214
  # End the subscription and shut down the internal HTTP server
@@ -213,6 +218,20 @@ manager.unsubscribe
213
218
  manager.subscribe
214
219
  ```
215
220
 
221
+ Here's an example of some output from the above callback:
222
+
223
+ ```
224
+ LastChange ==>
225
+ <?xml version="1.0"?>
226
+ <Event xmlns="urn:schemas-upnp-org:metadata-1-0/RCS/">
227
+ <InstanceID val="0">
228
+ <PresetNameList val="FactoryDefaults"/>
229
+ <Mute val="0" channel="Master"/>
230
+ <Volume val="20" channel="Master"/>
231
+ </InstanceID>
232
+ </Event>
233
+ ```
234
+
216
235
  While the default configurations are probably fine for most situations, you can configure both the internal HTTP server and the subscription manager when you call `on_event` by passing a configuration block:
217
236
 
218
237
  ```ruby
data/bin/upnp-list CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'optparse'
4
- require 'easy_upnp/ssdp_searcher'
4
+ require 'easy_upnp'
5
5
 
6
6
  DEFAULT_ST = 'ssdp:all'
7
7
 
@@ -1,3 +1,3 @@
1
1
  module EasyUpnp
2
- VERSION = '1.1.6'
2
+ VERSION = '1.1.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_upnp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Mullins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-21 00:00:00.000000000 Z
11
+ date: 2016-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake