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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4daca12d95badb79a0a206537e1f5a989d28cf73261f11f51cbbb89be8c5ef0
4
- data.tar.gz: f1b0615b6bfe1bc572ee7652692310f4af3b011c8d1e7ad5b823e39baf9a5b6a
3
+ metadata.gz: 5a9b5366976677f44438df2214399a404d369a065808d3450e75319401732374
4
+ data.tar.gz: 8fb3c8a44bf838277711d3377aa040e033f8052bae8faa6616be7e5d087a4ec4
5
5
  SHA512:
6
- metadata.gz: d80e6b6f240f82273ce5538376e6fe3c96d200d4ce8feabccf473853dc3ddaad17ea4936ea5c2ef7b97c8ab13a17842ad98ef30a5dcd348745b7c745f87ec8c5
7
- data.tar.gz: 0fd5f395ae17a30be812995a098a4a039ae96f657812472419ce006b6264cf7ce9d48b0605cdf64a2fb1d9be021f9d099841e103c2673ee9e4c354dc74aa8d10
6
+ metadata.gz: c8a7d233f5ee0a9943137946192092b92b3b841a6741223f56781dc91cc174b42183c84671efdd9600522f43db7312125092e433eeb01cda13cf0b135117fa57
7
+ data.tar.gz: 124ec5ab118789b284bf2a33e374f3273ec93147cbc74f7eea3b2870192fafc927fbd0065cff2bceec468e83905d527207d4f255c59df4275585aabe8c2f706f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- music_cast (0.2.0)
4
+ music_cast (0.3.0)
5
5
  faraday (~> 0.14.0)
6
6
 
7
7
  GEM
@@ -26,5 +26,6 @@ module MusicCast
26
26
  end
27
27
  end
28
28
 
29
+ require_relative 'api/set_mute'
29
30
  require_relative 'api/set_power'
30
31
  require_relative 'api/set_volume'
@@ -0,0 +1,11 @@
1
+ module MusicCast
2
+ class SetMute < API
3
+ def on
4
+ make_request('main/setMute?enable=true')
5
+ end
6
+
7
+ def off
8
+ make_request('main/setMute?enable=false')
9
+ end
10
+ end
11
+ end
@@ -1,11 +1,27 @@
1
1
  module MusicCast
2
2
  class SetVolume < API
3
3
  def to(value)
4
- if (0..100).include?(value)
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
@@ -1,3 +1,3 @@
1
1
  module MusicCast
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
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.2.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