samsung_wam_api 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +44 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/fixtures/vcr_cassettes/decrease_volume.yml +269 -0
- data/fixtures/vcr_cassettes/get_volume.yml +41 -0
- data/fixtures/vcr_cassettes/increase_volume.yml +269 -0
- data/fixtures/vcr_cassettes/off.yml +41 -0
- data/fixtures/vcr_cassettes/on.yml +41 -0
- data/fixtures/vcr_cassettes/set_volume.yml +117 -0
- data/fixtures/vcr_cassettes/turn_off.yml +79 -0
- data/fixtures/vcr_cassettes/turn_on.yml +79 -0
- data/lib/samsung_wam_api/device.rb +70 -0
- data/lib/samsung_wam_api/version.rb +3 -0
- data/lib/samsung_wam_api.rb +5 -0
- data/samsung_wam_api.gemspec +31 -0
- metadata +148 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8d0db0989cee9505f365c64e2522a3d777faed46
|
4
|
+
data.tar.gz: 8ebdf3e92ac1634d1ebfe951b0d25e65a3843f4e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 90fa9295a67cd104b804acf08f55f612fd8761577b91496b485f3bc5b8f9b8a9be96d7df942cea8c67a9806a09a3baa7349b2cbf92e1ba16af48e818349b966b
|
7
|
+
data.tar.gz: b968b0ced5f438eaab1df7928b3e723ea7a57b7de97a83c2dd6f24b7d432b4b9c8cdb40d600f06b10055eee4935d1b0e4ca7510b65e26bfe5c45a2925e29b076
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 Marek Hulan
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# SamsungWamApi
|
2
|
+
|
3
|
+
This gem provides wrapper around Samsung wireless audio multiroom control API. For more information about what commands your Samsung device support, see [this repo](https://github.com/bacl/WAM_API_DOC)
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'samsung_wam_api'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install samsung_wam_api
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require 'samsung_wam_api'
|
25
|
+
living_room_soundbar = SamsungWamApi::Device.new(ip: 192.168.0.1)
|
26
|
+
living_room_soundbar.power_on
|
27
|
+
living_room_soundbat.volume_up
|
28
|
+
```
|
29
|
+
|
30
|
+
## Development
|
31
|
+
|
32
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
33
|
+
|
34
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
35
|
+
|
36
|
+
## Contributing
|
37
|
+
|
38
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ares/samsung_wam_api.
|
39
|
+
|
40
|
+
|
41
|
+
## License
|
42
|
+
|
43
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
44
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "samsung_wam_api"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,269 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetVolume%3C/name%3E
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Host:
|
17
|
+
- 192.168.22.144:55001
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Wed, 17 Jan 2018 19:10:46 GMT
|
25
|
+
Server:
|
26
|
+
- Samsung/1.0
|
27
|
+
Content-Type:
|
28
|
+
- text/html
|
29
|
+
Content-Length:
|
30
|
+
- '223'
|
31
|
+
Connection:
|
32
|
+
- close
|
33
|
+
Last-Modified:
|
34
|
+
- Wed, 17 Jan 2018 19:10:46 GMT
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
38
|
+
result="ok"><volume>25</volume></response></UIC>
|
39
|
+
http_version:
|
40
|
+
recorded_at: Wed, 17 Jan 2018 19:10:47 GMT
|
41
|
+
- request:
|
42
|
+
method: get
|
43
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetVolume%3C/name%3E
|
44
|
+
body:
|
45
|
+
encoding: US-ASCII
|
46
|
+
string: ''
|
47
|
+
headers:
|
48
|
+
Accept-Encoding:
|
49
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
50
|
+
Accept:
|
51
|
+
- "*/*"
|
52
|
+
User-Agent:
|
53
|
+
- Ruby
|
54
|
+
Host:
|
55
|
+
- 192.168.22.144:55001
|
56
|
+
response:
|
57
|
+
status:
|
58
|
+
code: 200
|
59
|
+
message: OK
|
60
|
+
headers:
|
61
|
+
Date:
|
62
|
+
- Wed, 17 Jan 2018 19:10:47 GMT
|
63
|
+
Server:
|
64
|
+
- Samsung/1.0
|
65
|
+
Content-Type:
|
66
|
+
- text/html
|
67
|
+
Content-Length:
|
68
|
+
- '223'
|
69
|
+
Connection:
|
70
|
+
- close
|
71
|
+
Last-Modified:
|
72
|
+
- Wed, 17 Jan 2018 19:10:47 GMT
|
73
|
+
body:
|
74
|
+
encoding: UTF-8
|
75
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
76
|
+
result="ok"><volume>25</volume></response></UIC>
|
77
|
+
http_version:
|
78
|
+
recorded_at: Wed, 17 Jan 2018 19:10:47 GMT
|
79
|
+
- request:
|
80
|
+
method: get
|
81
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3ESetVolume%3C/name%3E%3Cp%20type=%22dec%22%20name=%22Volume%22%20val=%2224%22/%3E
|
82
|
+
body:
|
83
|
+
encoding: US-ASCII
|
84
|
+
string: ''
|
85
|
+
headers:
|
86
|
+
Accept-Encoding:
|
87
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
88
|
+
Accept:
|
89
|
+
- "*/*"
|
90
|
+
User-Agent:
|
91
|
+
- Ruby
|
92
|
+
Host:
|
93
|
+
- 192.168.22.144:55001
|
94
|
+
response:
|
95
|
+
status:
|
96
|
+
code: 200
|
97
|
+
message: OK
|
98
|
+
headers:
|
99
|
+
Date:
|
100
|
+
- Wed, 17 Jan 2018 19:10:47 GMT
|
101
|
+
Server:
|
102
|
+
- Samsung/1.0
|
103
|
+
Content-Type:
|
104
|
+
- text/html
|
105
|
+
Content-Length:
|
106
|
+
- '223'
|
107
|
+
Connection:
|
108
|
+
- close
|
109
|
+
Last-Modified:
|
110
|
+
- Wed, 17 Jan 2018 19:10:47 GMT
|
111
|
+
body:
|
112
|
+
encoding: UTF-8
|
113
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
114
|
+
result="ok"><volume>24</volume></response></UIC>
|
115
|
+
http_version:
|
116
|
+
recorded_at: Wed, 17 Jan 2018 19:10:47 GMT
|
117
|
+
- request:
|
118
|
+
method: get
|
119
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetVolume%3C/name%3E
|
120
|
+
body:
|
121
|
+
encoding: US-ASCII
|
122
|
+
string: ''
|
123
|
+
headers:
|
124
|
+
Accept-Encoding:
|
125
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
126
|
+
Accept:
|
127
|
+
- "*/*"
|
128
|
+
User-Agent:
|
129
|
+
- Ruby
|
130
|
+
Host:
|
131
|
+
- 192.168.22.144:55001
|
132
|
+
response:
|
133
|
+
status:
|
134
|
+
code: 200
|
135
|
+
message: OK
|
136
|
+
headers:
|
137
|
+
Date:
|
138
|
+
- Wed, 17 Jan 2018 19:10:47 GMT
|
139
|
+
Server:
|
140
|
+
- Samsung/1.0
|
141
|
+
Content-Type:
|
142
|
+
- text/html
|
143
|
+
Content-Length:
|
144
|
+
- '223'
|
145
|
+
Connection:
|
146
|
+
- close
|
147
|
+
Last-Modified:
|
148
|
+
- Wed, 17 Jan 2018 19:10:47 GMT
|
149
|
+
body:
|
150
|
+
encoding: UTF-8
|
151
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
152
|
+
result="ok"><volume>24</volume></response></UIC>
|
153
|
+
http_version:
|
154
|
+
recorded_at: Wed, 17 Jan 2018 19:10:48 GMT
|
155
|
+
- request:
|
156
|
+
method: get
|
157
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetVolume%3C/name%3E
|
158
|
+
body:
|
159
|
+
encoding: US-ASCII
|
160
|
+
string: ''
|
161
|
+
headers:
|
162
|
+
Accept-Encoding:
|
163
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
164
|
+
Accept:
|
165
|
+
- "*/*"
|
166
|
+
User-Agent:
|
167
|
+
- Ruby
|
168
|
+
Host:
|
169
|
+
- 192.168.22.144:55001
|
170
|
+
response:
|
171
|
+
status:
|
172
|
+
code: 200
|
173
|
+
message: OK
|
174
|
+
headers:
|
175
|
+
Date:
|
176
|
+
- Wed, 17 Jan 2018 19:10:47 GMT
|
177
|
+
Server:
|
178
|
+
- Samsung/1.0
|
179
|
+
Content-Type:
|
180
|
+
- text/html
|
181
|
+
Content-Length:
|
182
|
+
- '223'
|
183
|
+
Connection:
|
184
|
+
- close
|
185
|
+
Last-Modified:
|
186
|
+
- Wed, 17 Jan 2018 19:10:47 GMT
|
187
|
+
body:
|
188
|
+
encoding: UTF-8
|
189
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
190
|
+
result="ok"><volume>24</volume></response></UIC>
|
191
|
+
http_version:
|
192
|
+
recorded_at: Wed, 17 Jan 2018 19:10:48 GMT
|
193
|
+
- request:
|
194
|
+
method: get
|
195
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3ESetVolume%3C/name%3E%3Cp%20type=%22dec%22%20name=%22Volume%22%20val=%2220%22/%3E
|
196
|
+
body:
|
197
|
+
encoding: US-ASCII
|
198
|
+
string: ''
|
199
|
+
headers:
|
200
|
+
Accept-Encoding:
|
201
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
202
|
+
Accept:
|
203
|
+
- "*/*"
|
204
|
+
User-Agent:
|
205
|
+
- Ruby
|
206
|
+
Host:
|
207
|
+
- 192.168.22.144:55001
|
208
|
+
response:
|
209
|
+
status:
|
210
|
+
code: 200
|
211
|
+
message: OK
|
212
|
+
headers:
|
213
|
+
Date:
|
214
|
+
- Wed, 17 Jan 2018 19:10:47 GMT
|
215
|
+
Server:
|
216
|
+
- Samsung/1.0
|
217
|
+
Content-Type:
|
218
|
+
- text/html
|
219
|
+
Content-Length:
|
220
|
+
- '223'
|
221
|
+
Connection:
|
222
|
+
- close
|
223
|
+
Last-Modified:
|
224
|
+
- Wed, 17 Jan 2018 19:10:47 GMT
|
225
|
+
body:
|
226
|
+
encoding: UTF-8
|
227
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
228
|
+
result="ok"><volume>20</volume></response></UIC>
|
229
|
+
http_version:
|
230
|
+
recorded_at: Wed, 17 Jan 2018 19:10:48 GMT
|
231
|
+
- request:
|
232
|
+
method: get
|
233
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetVolume%3C/name%3E
|
234
|
+
body:
|
235
|
+
encoding: US-ASCII
|
236
|
+
string: ''
|
237
|
+
headers:
|
238
|
+
Accept-Encoding:
|
239
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
240
|
+
Accept:
|
241
|
+
- "*/*"
|
242
|
+
User-Agent:
|
243
|
+
- Ruby
|
244
|
+
Host:
|
245
|
+
- 192.168.22.144:55001
|
246
|
+
response:
|
247
|
+
status:
|
248
|
+
code: 200
|
249
|
+
message: OK
|
250
|
+
headers:
|
251
|
+
Date:
|
252
|
+
- Wed, 17 Jan 2018 19:10:47 GMT
|
253
|
+
Server:
|
254
|
+
- Samsung/1.0
|
255
|
+
Content-Type:
|
256
|
+
- text/html
|
257
|
+
Content-Length:
|
258
|
+
- '223'
|
259
|
+
Connection:
|
260
|
+
- close
|
261
|
+
Last-Modified:
|
262
|
+
- Wed, 17 Jan 2018 19:10:47 GMT
|
263
|
+
body:
|
264
|
+
encoding: UTF-8
|
265
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
266
|
+
result="ok"><volume>20</volume></response></UIC>
|
267
|
+
http_version:
|
268
|
+
recorded_at: Wed, 17 Jan 2018 19:10:48 GMT
|
269
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,41 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetVolume%3C/name%3E
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Host:
|
17
|
+
- 192.168.22.144:55001
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Wed, 17 Jan 2018 19:01:50 GMT
|
25
|
+
Server:
|
26
|
+
- Samsung/1.0
|
27
|
+
Content-Type:
|
28
|
+
- text/html
|
29
|
+
Content-Length:
|
30
|
+
- '223'
|
31
|
+
Connection:
|
32
|
+
- close
|
33
|
+
Last-Modified:
|
34
|
+
- Wed, 17 Jan 2018 19:01:50 GMT
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
38
|
+
result="ok"><volume>16</volume></response></UIC>
|
39
|
+
http_version:
|
40
|
+
recorded_at: Wed, 17 Jan 2018 19:01:51 GMT
|
41
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,269 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetVolume%3C/name%3E
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Host:
|
17
|
+
- 192.168.22.144:55001
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Wed, 17 Jan 2018 19:09:23 GMT
|
25
|
+
Server:
|
26
|
+
- Samsung/1.0
|
27
|
+
Content-Type:
|
28
|
+
- text/html
|
29
|
+
Content-Length:
|
30
|
+
- '223'
|
31
|
+
Connection:
|
32
|
+
- close
|
33
|
+
Last-Modified:
|
34
|
+
- Wed, 17 Jan 2018 19:09:23 GMT
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
38
|
+
result="ok"><volume>20</volume></response></UIC>
|
39
|
+
http_version:
|
40
|
+
recorded_at: Wed, 17 Jan 2018 19:09:24 GMT
|
41
|
+
- request:
|
42
|
+
method: get
|
43
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetVolume%3C/name%3E
|
44
|
+
body:
|
45
|
+
encoding: US-ASCII
|
46
|
+
string: ''
|
47
|
+
headers:
|
48
|
+
Accept-Encoding:
|
49
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
50
|
+
Accept:
|
51
|
+
- "*/*"
|
52
|
+
User-Agent:
|
53
|
+
- Ruby
|
54
|
+
Host:
|
55
|
+
- 192.168.22.144:55001
|
56
|
+
response:
|
57
|
+
status:
|
58
|
+
code: 200
|
59
|
+
message: OK
|
60
|
+
headers:
|
61
|
+
Date:
|
62
|
+
- Wed, 17 Jan 2018 19:09:23 GMT
|
63
|
+
Server:
|
64
|
+
- Samsung/1.0
|
65
|
+
Content-Type:
|
66
|
+
- text/html
|
67
|
+
Content-Length:
|
68
|
+
- '223'
|
69
|
+
Connection:
|
70
|
+
- close
|
71
|
+
Last-Modified:
|
72
|
+
- Wed, 17 Jan 2018 19:09:23 GMT
|
73
|
+
body:
|
74
|
+
encoding: UTF-8
|
75
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
76
|
+
result="ok"><volume>20</volume></response></UIC>
|
77
|
+
http_version:
|
78
|
+
recorded_at: Wed, 17 Jan 2018 19:09:24 GMT
|
79
|
+
- request:
|
80
|
+
method: get
|
81
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3ESetVolume%3C/name%3E%3Cp%20type=%22dec%22%20name=%22Volume%22%20val=%2221%22/%3E
|
82
|
+
body:
|
83
|
+
encoding: US-ASCII
|
84
|
+
string: ''
|
85
|
+
headers:
|
86
|
+
Accept-Encoding:
|
87
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
88
|
+
Accept:
|
89
|
+
- "*/*"
|
90
|
+
User-Agent:
|
91
|
+
- Ruby
|
92
|
+
Host:
|
93
|
+
- 192.168.22.144:55001
|
94
|
+
response:
|
95
|
+
status:
|
96
|
+
code: 200
|
97
|
+
message: OK
|
98
|
+
headers:
|
99
|
+
Date:
|
100
|
+
- Wed, 17 Jan 2018 19:09:23 GMT
|
101
|
+
Server:
|
102
|
+
- Samsung/1.0
|
103
|
+
Content-Type:
|
104
|
+
- text/html
|
105
|
+
Content-Length:
|
106
|
+
- '223'
|
107
|
+
Connection:
|
108
|
+
- close
|
109
|
+
Last-Modified:
|
110
|
+
- Wed, 17 Jan 2018 19:09:23 GMT
|
111
|
+
body:
|
112
|
+
encoding: UTF-8
|
113
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
114
|
+
result="ok"><volume>21</volume></response></UIC>
|
115
|
+
http_version:
|
116
|
+
recorded_at: Wed, 17 Jan 2018 19:09:24 GMT
|
117
|
+
- request:
|
118
|
+
method: get
|
119
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetVolume%3C/name%3E
|
120
|
+
body:
|
121
|
+
encoding: US-ASCII
|
122
|
+
string: ''
|
123
|
+
headers:
|
124
|
+
Accept-Encoding:
|
125
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
126
|
+
Accept:
|
127
|
+
- "*/*"
|
128
|
+
User-Agent:
|
129
|
+
- Ruby
|
130
|
+
Host:
|
131
|
+
- 192.168.22.144:55001
|
132
|
+
response:
|
133
|
+
status:
|
134
|
+
code: 200
|
135
|
+
message: OK
|
136
|
+
headers:
|
137
|
+
Date:
|
138
|
+
- Wed, 17 Jan 2018 19:09:23 GMT
|
139
|
+
Server:
|
140
|
+
- Samsung/1.0
|
141
|
+
Content-Type:
|
142
|
+
- text/html
|
143
|
+
Content-Length:
|
144
|
+
- '223'
|
145
|
+
Connection:
|
146
|
+
- close
|
147
|
+
Last-Modified:
|
148
|
+
- Wed, 17 Jan 2018 19:09:23 GMT
|
149
|
+
body:
|
150
|
+
encoding: UTF-8
|
151
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
152
|
+
result="ok"><volume>21</volume></response></UIC>
|
153
|
+
http_version:
|
154
|
+
recorded_at: Wed, 17 Jan 2018 19:09:24 GMT
|
155
|
+
- request:
|
156
|
+
method: get
|
157
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetVolume%3C/name%3E
|
158
|
+
body:
|
159
|
+
encoding: US-ASCII
|
160
|
+
string: ''
|
161
|
+
headers:
|
162
|
+
Accept-Encoding:
|
163
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
164
|
+
Accept:
|
165
|
+
- "*/*"
|
166
|
+
User-Agent:
|
167
|
+
- Ruby
|
168
|
+
Host:
|
169
|
+
- 192.168.22.144:55001
|
170
|
+
response:
|
171
|
+
status:
|
172
|
+
code: 200
|
173
|
+
message: OK
|
174
|
+
headers:
|
175
|
+
Date:
|
176
|
+
- Wed, 17 Jan 2018 19:09:23 GMT
|
177
|
+
Server:
|
178
|
+
- Samsung/1.0
|
179
|
+
Content-Type:
|
180
|
+
- text/html
|
181
|
+
Content-Length:
|
182
|
+
- '223'
|
183
|
+
Connection:
|
184
|
+
- close
|
185
|
+
Last-Modified:
|
186
|
+
- Wed, 17 Jan 2018 19:09:23 GMT
|
187
|
+
body:
|
188
|
+
encoding: UTF-8
|
189
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
190
|
+
result="ok"><volume>21</volume></response></UIC>
|
191
|
+
http_version:
|
192
|
+
recorded_at: Wed, 17 Jan 2018 19:09:24 GMT
|
193
|
+
- request:
|
194
|
+
method: get
|
195
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3ESetVolume%3C/name%3E%3Cp%20type=%22dec%22%20name=%22Volume%22%20val=%2225%22/%3E
|
196
|
+
body:
|
197
|
+
encoding: US-ASCII
|
198
|
+
string: ''
|
199
|
+
headers:
|
200
|
+
Accept-Encoding:
|
201
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
202
|
+
Accept:
|
203
|
+
- "*/*"
|
204
|
+
User-Agent:
|
205
|
+
- Ruby
|
206
|
+
Host:
|
207
|
+
- 192.168.22.144:55001
|
208
|
+
response:
|
209
|
+
status:
|
210
|
+
code: 200
|
211
|
+
message: OK
|
212
|
+
headers:
|
213
|
+
Date:
|
214
|
+
- Wed, 17 Jan 2018 19:09:23 GMT
|
215
|
+
Server:
|
216
|
+
- Samsung/1.0
|
217
|
+
Content-Type:
|
218
|
+
- text/html
|
219
|
+
Content-Length:
|
220
|
+
- '223'
|
221
|
+
Connection:
|
222
|
+
- close
|
223
|
+
Last-Modified:
|
224
|
+
- Wed, 17 Jan 2018 19:09:23 GMT
|
225
|
+
body:
|
226
|
+
encoding: UTF-8
|
227
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
228
|
+
result="ok"><volume>25</volume></response></UIC>
|
229
|
+
http_version:
|
230
|
+
recorded_at: Wed, 17 Jan 2018 19:09:24 GMT
|
231
|
+
- request:
|
232
|
+
method: get
|
233
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetVolume%3C/name%3E
|
234
|
+
body:
|
235
|
+
encoding: US-ASCII
|
236
|
+
string: ''
|
237
|
+
headers:
|
238
|
+
Accept-Encoding:
|
239
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
240
|
+
Accept:
|
241
|
+
- "*/*"
|
242
|
+
User-Agent:
|
243
|
+
- Ruby
|
244
|
+
Host:
|
245
|
+
- 192.168.22.144:55001
|
246
|
+
response:
|
247
|
+
status:
|
248
|
+
code: 200
|
249
|
+
message: OK
|
250
|
+
headers:
|
251
|
+
Date:
|
252
|
+
- Wed, 17 Jan 2018 19:09:24 GMT
|
253
|
+
Server:
|
254
|
+
- Samsung/1.0
|
255
|
+
Content-Type:
|
256
|
+
- text/html
|
257
|
+
Content-Length:
|
258
|
+
- '223'
|
259
|
+
Connection:
|
260
|
+
- close
|
261
|
+
Last-Modified:
|
262
|
+
- Wed, 17 Jan 2018 19:09:24 GMT
|
263
|
+
body:
|
264
|
+
encoding: UTF-8
|
265
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
266
|
+
result="ok"><volume>25</volume></response></UIC>
|
267
|
+
http_version:
|
268
|
+
recorded_at: Wed, 17 Jan 2018 19:09:24 GMT
|
269
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,41 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetPowerStatus%3C/name%3E
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Host:
|
17
|
+
- 192.168.22.144:55001
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Wed, 17 Jan 2018 18:50:36 GMT
|
25
|
+
Server:
|
26
|
+
- Samsung/1.0
|
27
|
+
Content-Type:
|
28
|
+
- text/html
|
29
|
+
Content-Length:
|
30
|
+
- '238'
|
31
|
+
Connection:
|
32
|
+
- close
|
33
|
+
Last-Modified:
|
34
|
+
- Wed, 17 Jan 2018 18:50:36 GMT
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>PowerStatus</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier>public</user_identifier><response
|
38
|
+
result="ok"><powerStatus>0</powerStatus></response></UIC>
|
39
|
+
http_version:
|
40
|
+
recorded_at: Wed, 17 Jan 2018 18:50:36 GMT
|
41
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,41 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetPowerStatus%3C/name%3E
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Host:
|
17
|
+
- 192.168.22.144:55001
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Wed, 17 Jan 2018 18:50:35 GMT
|
25
|
+
Server:
|
26
|
+
- Samsung/1.0
|
27
|
+
Content-Type:
|
28
|
+
- text/html
|
29
|
+
Content-Length:
|
30
|
+
- '238'
|
31
|
+
Connection:
|
32
|
+
- close
|
33
|
+
Last-Modified:
|
34
|
+
- Wed, 17 Jan 2018 18:50:35 GMT
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>PowerStatus</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier>public</user_identifier><response
|
38
|
+
result="ok"><powerStatus>1</powerStatus></response></UIC>
|
39
|
+
http_version:
|
40
|
+
recorded_at: Wed, 17 Jan 2018 18:50:36 GMT
|
41
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,117 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetVolume%3C/name%3E
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Host:
|
17
|
+
- 192.168.22.144:55001
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Wed, 17 Jan 2018 19:09:46 GMT
|
25
|
+
Server:
|
26
|
+
- Samsung/1.0
|
27
|
+
Content-Type:
|
28
|
+
- text/html
|
29
|
+
Content-Length:
|
30
|
+
- '223'
|
31
|
+
Connection:
|
32
|
+
- close
|
33
|
+
Last-Modified:
|
34
|
+
- Wed, 17 Jan 2018 19:09:46 GMT
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
38
|
+
result="ok"><volume>16</volume></response></UIC>
|
39
|
+
http_version:
|
40
|
+
recorded_at: Wed, 17 Jan 2018 19:09:47 GMT
|
41
|
+
- request:
|
42
|
+
method: get
|
43
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3ESetVolume%3C/name%3E%3Cp%20type=%22dec%22%20name=%22Volume%22%20val=%2220%22/%3E
|
44
|
+
body:
|
45
|
+
encoding: US-ASCII
|
46
|
+
string: ''
|
47
|
+
headers:
|
48
|
+
Accept-Encoding:
|
49
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
50
|
+
Accept:
|
51
|
+
- "*/*"
|
52
|
+
User-Agent:
|
53
|
+
- Ruby
|
54
|
+
Host:
|
55
|
+
- 192.168.22.144:55001
|
56
|
+
response:
|
57
|
+
status:
|
58
|
+
code: 200
|
59
|
+
message: OK
|
60
|
+
headers:
|
61
|
+
Date:
|
62
|
+
- Wed, 17 Jan 2018 19:09:46 GMT
|
63
|
+
Server:
|
64
|
+
- Samsung/1.0
|
65
|
+
Content-Type:
|
66
|
+
- text/html
|
67
|
+
Content-Length:
|
68
|
+
- '223'
|
69
|
+
Connection:
|
70
|
+
- close
|
71
|
+
Last-Modified:
|
72
|
+
- Wed, 17 Jan 2018 19:09:46 GMT
|
73
|
+
body:
|
74
|
+
encoding: UTF-8
|
75
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
76
|
+
result="ok"><volume>20</volume></response></UIC>
|
77
|
+
http_version:
|
78
|
+
recorded_at: Wed, 17 Jan 2018 19:09:47 GMT
|
79
|
+
- request:
|
80
|
+
method: get
|
81
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetVolume%3C/name%3E
|
82
|
+
body:
|
83
|
+
encoding: US-ASCII
|
84
|
+
string: ''
|
85
|
+
headers:
|
86
|
+
Accept-Encoding:
|
87
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
88
|
+
Accept:
|
89
|
+
- "*/*"
|
90
|
+
User-Agent:
|
91
|
+
- Ruby
|
92
|
+
Host:
|
93
|
+
- 192.168.22.144:55001
|
94
|
+
response:
|
95
|
+
status:
|
96
|
+
code: 200
|
97
|
+
message: OK
|
98
|
+
headers:
|
99
|
+
Date:
|
100
|
+
- Wed, 17 Jan 2018 19:09:46 GMT
|
101
|
+
Server:
|
102
|
+
- Samsung/1.0
|
103
|
+
Content-Type:
|
104
|
+
- text/html
|
105
|
+
Content-Length:
|
106
|
+
- '223'
|
107
|
+
Connection:
|
108
|
+
- close
|
109
|
+
Last-Modified:
|
110
|
+
- Wed, 17 Jan 2018 19:09:46 GMT
|
111
|
+
body:
|
112
|
+
encoding: UTF-8
|
113
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>VolumeLevel</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier></user_identifier><response
|
114
|
+
result="ok"><volume>20</volume></response></UIC>
|
115
|
+
http_version:
|
116
|
+
recorded_at: Wed, 17 Jan 2018 19:09:47 GMT
|
117
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,79 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3ESetPowerStatus%3C/name%3E%3Cp%20type=%22dec%22%20name=%22powerstatus%22%20val=%220%22/%3E
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Host:
|
17
|
+
- 192.168.22.144:55001
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Wed, 17 Jan 2018 18:53:13 GMT
|
25
|
+
Server:
|
26
|
+
- Samsung/1.0
|
27
|
+
Content-Type:
|
28
|
+
- text/html
|
29
|
+
Content-Length:
|
30
|
+
- '238'
|
31
|
+
Connection:
|
32
|
+
- close
|
33
|
+
Last-Modified:
|
34
|
+
- Wed, 17 Jan 2018 18:53:13 GMT
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>PowerStatus</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier>public</user_identifier><response
|
38
|
+
result="ok"><powerStatus>0</powerStatus></response></UIC>
|
39
|
+
http_version:
|
40
|
+
recorded_at: Wed, 17 Jan 2018 18:53:13 GMT
|
41
|
+
- request:
|
42
|
+
method: get
|
43
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetPowerStatus%3C/name%3E
|
44
|
+
body:
|
45
|
+
encoding: US-ASCII
|
46
|
+
string: ''
|
47
|
+
headers:
|
48
|
+
Accept-Encoding:
|
49
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
50
|
+
Accept:
|
51
|
+
- "*/*"
|
52
|
+
User-Agent:
|
53
|
+
- Ruby
|
54
|
+
Host:
|
55
|
+
- 192.168.22.144:55001
|
56
|
+
response:
|
57
|
+
status:
|
58
|
+
code: 200
|
59
|
+
message: OK
|
60
|
+
headers:
|
61
|
+
Date:
|
62
|
+
- Wed, 17 Jan 2018 18:53:13 GMT
|
63
|
+
Server:
|
64
|
+
- Samsung/1.0
|
65
|
+
Content-Type:
|
66
|
+
- text/html
|
67
|
+
Content-Length:
|
68
|
+
- '238'
|
69
|
+
Connection:
|
70
|
+
- close
|
71
|
+
Last-Modified:
|
72
|
+
- Wed, 17 Jan 2018 18:53:13 GMT
|
73
|
+
body:
|
74
|
+
encoding: UTF-8
|
75
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>PowerStatus</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier>public</user_identifier><response
|
76
|
+
result="ok"><powerStatus>0</powerStatus></response></UIC>
|
77
|
+
http_version:
|
78
|
+
recorded_at: Wed, 17 Jan 2018 18:53:14 GMT
|
79
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,79 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3ESetPowerStatus%3C/name%3E%3Cp%20type=%22dec%22%20name=%22powerstatus%22%20val=%221%22/%3E
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Host:
|
17
|
+
- 192.168.22.144:55001
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Wed, 17 Jan 2018 18:52:30 GMT
|
25
|
+
Server:
|
26
|
+
- Samsung/1.0
|
27
|
+
Content-Type:
|
28
|
+
- text/html
|
29
|
+
Content-Length:
|
30
|
+
- '238'
|
31
|
+
Connection:
|
32
|
+
- close
|
33
|
+
Last-Modified:
|
34
|
+
- Wed, 17 Jan 2018 18:52:30 GMT
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>PowerStatus</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier>public</user_identifier><response
|
38
|
+
result="ok"><powerStatus>1</powerStatus></response></UIC>
|
39
|
+
http_version:
|
40
|
+
recorded_at: Wed, 17 Jan 2018 18:52:31 GMT
|
41
|
+
- request:
|
42
|
+
method: get
|
43
|
+
uri: http://192.168.22.144:55001/UIC?cmd=%3Cname%3EGetPowerStatus%3C/name%3E
|
44
|
+
body:
|
45
|
+
encoding: US-ASCII
|
46
|
+
string: ''
|
47
|
+
headers:
|
48
|
+
Accept-Encoding:
|
49
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
50
|
+
Accept:
|
51
|
+
- "*/*"
|
52
|
+
User-Agent:
|
53
|
+
- Ruby
|
54
|
+
Host:
|
55
|
+
- 192.168.22.144:55001
|
56
|
+
response:
|
57
|
+
status:
|
58
|
+
code: 200
|
59
|
+
message: OK
|
60
|
+
headers:
|
61
|
+
Date:
|
62
|
+
- Wed, 17 Jan 2018 18:52:30 GMT
|
63
|
+
Server:
|
64
|
+
- Samsung/1.0
|
65
|
+
Content-Type:
|
66
|
+
- text/html
|
67
|
+
Content-Length:
|
68
|
+
- '238'
|
69
|
+
Connection:
|
70
|
+
- close
|
71
|
+
Last-Modified:
|
72
|
+
- Wed, 17 Jan 2018 18:52:30 GMT
|
73
|
+
body:
|
74
|
+
encoding: UTF-8
|
75
|
+
string: <?xml version="1.0" encoding="UTF-8"?><UIC><method>PowerStatus</method><version>1.0</version><speakerip>192.168.22.144</speakerip><user_identifier>public</user_identifier><response
|
76
|
+
result="ok"><powerStatus>1</powerStatus></response></UIC>
|
77
|
+
http_version:
|
78
|
+
recorded_at: Wed, 17 Jan 2018 18:52:31 GMT
|
79
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'uri'
|
2
|
+
require 'net/http'
|
3
|
+
require 'active_support/core_ext/hash/conversions'
|
4
|
+
require 'logger'
|
5
|
+
require 'timeout'
|
6
|
+
|
7
|
+
module SamsungWamApi
|
8
|
+
class Device
|
9
|
+
def initialize(ip:, port: '55001', endpoint: 'UIC', logger: Logger.new(STDOUT), timeout_seconds: 3)
|
10
|
+
@ip = ip
|
11
|
+
@port = port
|
12
|
+
@endpoint = endpoint
|
13
|
+
@logger = logger
|
14
|
+
@timeout_seconds = timeout_seconds
|
15
|
+
end
|
16
|
+
|
17
|
+
# returns '1' (on) or '0' (off)
|
18
|
+
def power_status
|
19
|
+
command!('<name>GetPowerStatus</name>')['powerStatus'].to_i
|
20
|
+
end
|
21
|
+
|
22
|
+
def on?
|
23
|
+
power_status == 1
|
24
|
+
end
|
25
|
+
|
26
|
+
def off?
|
27
|
+
power_status == 0
|
28
|
+
end
|
29
|
+
|
30
|
+
def on!
|
31
|
+
command!('<name>SetPowerStatus</name><p type="dec" name="powerstatus" val="1"/>')
|
32
|
+
end
|
33
|
+
|
34
|
+
def off!
|
35
|
+
command!('<name>SetPowerStatus</name><p type="dec" name="powerstatus" val="0"/>')
|
36
|
+
end
|
37
|
+
|
38
|
+
def volume
|
39
|
+
command!('<name>GetVolume</name>')['volume'].to_i
|
40
|
+
end
|
41
|
+
|
42
|
+
def set_volume(vol)
|
43
|
+
command!('<name>SetVolume</name><p type="dec" name="Volume" val="' + vol.to_i.to_s + '"/>')
|
44
|
+
end
|
45
|
+
|
46
|
+
def increase_volume(step = 1)
|
47
|
+
set_volume(volume + step.to_i)
|
48
|
+
end
|
49
|
+
|
50
|
+
def decrease_volume(step = 1)
|
51
|
+
set_volume(volume - step.to_i)
|
52
|
+
end
|
53
|
+
|
54
|
+
def command!(cmd)
|
55
|
+
query = "http://#{@ip}:#{@port}/#{@endpoint}?cmd=#{URI.encode(cmd)}"
|
56
|
+
@logger.debug { "Firing query '#{URI.decode(query)}'" }
|
57
|
+
|
58
|
+
# if we e.g. request to power on device which is already on, we never receive a response, therefore we use configurable timeout
|
59
|
+
raw_response = nil
|
60
|
+
Timeout::timeout(@timeout_seconds) {
|
61
|
+
raw_response = Net::HTTP.get(URI(query))
|
62
|
+
}
|
63
|
+
parsed_response = Hash.from_xml(raw_response)
|
64
|
+
@logger.debug { "Got response:\n #{raw_response.inspect} \nparsed to:\n#{parsed_response}" }
|
65
|
+
parsed_response[@endpoint]['response']
|
66
|
+
rescue Timeout::Error
|
67
|
+
@logger.warn "Timeout and #{@timeout_seconds} seconds, you most likely did invalid operation"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'samsung_wam_api/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "samsung_wam_api"
|
8
|
+
spec.version = SamsungWamApi::VERSION
|
9
|
+
spec.authors = ["Marek Hulan"]
|
10
|
+
spec.email = ["mhulan@redhat.com"]
|
11
|
+
|
12
|
+
spec.summary = 'Gem provides Ruby Samsung WAM API wrapper'
|
13
|
+
spec.description = 'Gem provides Ruby Samsung WAM API wrapper'
|
14
|
+
spec.homepage = 'https://github.com/ares/samsung_wam_api'
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.14"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
27
|
+
spec.add_development_dependency "webmock", "~> 3.2"
|
28
|
+
spec.add_development_dependency "vcr", "~> 4.0"
|
29
|
+
|
30
|
+
spec.add_dependency 'activesupport'
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: samsung_wam_api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Marek Hulan
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-01-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.14'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.14'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: webmock
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.2'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: vcr
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '4.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '4.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: activesupport
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: Gem provides Ruby Samsung WAM API wrapper
|
98
|
+
email:
|
99
|
+
- mhulan@redhat.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- ".gitignore"
|
105
|
+
- ".travis.yml"
|
106
|
+
- Gemfile
|
107
|
+
- LICENSE.txt
|
108
|
+
- README.md
|
109
|
+
- Rakefile
|
110
|
+
- bin/console
|
111
|
+
- bin/setup
|
112
|
+
- fixtures/vcr_cassettes/decrease_volume.yml
|
113
|
+
- fixtures/vcr_cassettes/get_volume.yml
|
114
|
+
- fixtures/vcr_cassettes/increase_volume.yml
|
115
|
+
- fixtures/vcr_cassettes/off.yml
|
116
|
+
- fixtures/vcr_cassettes/on.yml
|
117
|
+
- fixtures/vcr_cassettes/set_volume.yml
|
118
|
+
- fixtures/vcr_cassettes/turn_off.yml
|
119
|
+
- fixtures/vcr_cassettes/turn_on.yml
|
120
|
+
- lib/samsung_wam_api.rb
|
121
|
+
- lib/samsung_wam_api/device.rb
|
122
|
+
- lib/samsung_wam_api/version.rb
|
123
|
+
- samsung_wam_api.gemspec
|
124
|
+
homepage: https://github.com/ares/samsung_wam_api
|
125
|
+
licenses:
|
126
|
+
- MIT
|
127
|
+
metadata: {}
|
128
|
+
post_install_message:
|
129
|
+
rdoc_options: []
|
130
|
+
require_paths:
|
131
|
+
- lib
|
132
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - ">="
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0'
|
137
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
|
+
requirements:
|
139
|
+
- - ">="
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
requirements: []
|
143
|
+
rubyforge_project:
|
144
|
+
rubygems_version: 2.4.5
|
145
|
+
signing_key:
|
146
|
+
specification_version: 4
|
147
|
+
summary: Gem provides Ruby Samsung WAM API wrapper
|
148
|
+
test_files: []
|