music_cast 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/music_cast/api.rb +1 -0
- data/lib/music_cast/api/set_mute.rb +11 -0
- data/lib/music_cast/api/set_volume.rb +19 -3
- data/lib/music_cast/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a9b5366976677f44438df2214399a404d369a065808d3450e75319401732374
|
4
|
+
data.tar.gz: 8fb3c8a44bf838277711d3377aa040e033f8052bae8faa6616be7e5d087a4ec4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8a7d233f5ee0a9943137946192092b92b3b841a6741223f56781dc91cc174b42183c84671efdd9600522f43db7312125092e433eeb01cda13cf0b135117fa57
|
7
|
+
data.tar.gz: 124ec5ab118789b284bf2a33e374f3273ec93147cbc74f7eea3b2870192fafc927fbd0065cff2bceec468e83905d527207d4f255c59df4275585aabe8c2f706f
|
data/Gemfile.lock
CHANGED
data/lib/music_cast/api.rb
CHANGED
@@ -1,11 +1,27 @@
|
|
1
1
|
module MusicCast
|
2
2
|
class SetVolume < API
|
3
3
|
def to(value)
|
4
|
-
|
5
|
-
make_request("main/setVolume?volume=#{value.to_i}")
|
6
|
-
else
|
4
|
+
unless (0..100).include?(value.to_i)
|
7
5
|
raise RequestError, "value #{value} out of bounds 0..100"
|
8
6
|
end
|
7
|
+
|
8
|
+
make_request("main/setVolume?volume=#{value.to_i}")
|
9
|
+
end
|
10
|
+
|
11
|
+
def increment(step=nil)
|
12
|
+
if step
|
13
|
+
make_request("main/setVolume?volume=up&step=#{step.to_i}")
|
14
|
+
else
|
15
|
+
make_request('main/setVolume?volume=up')
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def decrement(step=nil)
|
20
|
+
if step
|
21
|
+
make_request("main/setVolume?volume=down&step=#{step.to_i}")
|
22
|
+
else
|
23
|
+
make_request('main/setVolume?volume=down')
|
24
|
+
end
|
9
25
|
end
|
10
26
|
end
|
11
27
|
end
|
data/lib/music_cast/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: music_cast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karl Entwistle
|
@@ -132,6 +132,7 @@ files:
|
|
132
132
|
- bin/setup
|
133
133
|
- lib/music_cast.rb
|
134
134
|
- lib/music_cast/api.rb
|
135
|
+
- lib/music_cast/api/set_mute.rb
|
135
136
|
- lib/music_cast/api/set_power.rb
|
136
137
|
- lib/music_cast/api/set_volume.rb
|
137
138
|
- lib/music_cast/configuration.rb
|