music_cast 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a9b5366976677f44438df2214399a404d369a065808d3450e75319401732374
4
- data.tar.gz: 8fb3c8a44bf838277711d3377aa040e033f8052bae8faa6616be7e5d087a4ec4
3
+ metadata.gz: 9ba0fe27dacbc0c4db860fbb944900440148a7ae74f351f46672f4b3d6528bbb
4
+ data.tar.gz: 8f1f35ff25230e3cbbe1efe536c4ee371759077647ef4f389b46b57dcb2bec1a
5
5
  SHA512:
6
- metadata.gz: c8a7d233f5ee0a9943137946192092b92b3b841a6741223f56781dc91cc174b42183c84671efdd9600522f43db7312125092e433eeb01cda13cf0b135117fa57
7
- data.tar.gz: 124ec5ab118789b284bf2a33e374f3273ec93147cbc74f7eea3b2870192fafc927fbd0065cff2bceec468e83905d527207d4f255c59df4275585aabe8c2f706f
6
+ metadata.gz: 676ee2860bf7b9a3a1db5f3ed4a47af2e617009e2ad580f6607f89fb1f35ec73bb617cc9b2a96d4dcf2b9c1c4d9b61793c8a573dedff100fa21d35b41be5ebd3
7
+ data.tar.gz: d2671976f0d9e02abba31aaa82668b8ca87a27440a8d660ff85d2717f7b1d037cfece7a4950a5b84600ccf0448b70a1d437ead5c0cdfdf0cb5e924651e864f4e
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- music_cast (0.3.0)
4
+ music_cast (0.3.1)
5
5
  faraday (~> 0.14.0)
6
6
 
7
7
  GEM
@@ -52,4 +52,4 @@ DEPENDENCIES
52
52
  webmock (~> 3.3)
53
53
 
54
54
  BUNDLED WITH
55
- 1.16.1
55
+ 1.16.3
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MusicCast
2
2
 
3
- Control System for Yamaha MusicCast written in Ruby
3
+ Ruby Control System for Yamaha MusicCast speakers
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,6 +18,12 @@ Or install it yourself as:
18
18
 
19
19
  $ gem install music_cast
20
20
 
21
+ ## Prerequisites
22
+
23
+ For the HTTP API to function correctly in an integrated system, the MusicCast devices must be on a fixed or bound IP Address. To avoid network loops through the wireless “extend” functionality of MusicCast products you should set the device to wired or wireless only - through the web GUI on the MusicCast device:
24
+
25
+ ![screen shot 2018-03-25 at 22 22 48](https://user-images.githubusercontent.com/666397/37880091-294978fc-307b-11e8-8985-3ee4e3f11fc6.png)
26
+
21
27
  ## Configuration
22
28
 
23
29
  The configuration options can be set by using the `configure` helper
@@ -34,6 +40,54 @@ The following is the full list of available configuration options:
34
40
  ip_address # The static IP address of your speaker
35
41
  ```
36
42
 
43
+ ## Usage
44
+
45
+ This gem is intended to be a thin wrapper around the existing `YamahaExtendedControl/v1` API. The class structures are influenced by the existing API structure. This is a list of all the functions that can currently be performed with this gem.
46
+
47
+ ### Status
48
+
49
+ Get device status
50
+
51
+ ```ruby
52
+ status = MusicCast::GetStatus.new
53
+ status.to_json # Current status as JSON
54
+ ```
55
+
56
+ ### Power Functions
57
+
58
+ Set power status and enable/disable auto-standby
59
+
60
+ ```ruby
61
+ power = MusicCast::SetPower.new
62
+ power.on # Power on
63
+ power.standby # Standby
64
+ power.toggle # Power Toggle
65
+ power.enable_auto_standby # Enable Auto Power Standby
66
+ power.disable_auto_standby # Disable Auto Power Standby
67
+ ```
68
+
69
+ ### Volume Commands
70
+
71
+ Set sound volume level
72
+
73
+ ```ruby
74
+ volume = MusicCast::SetVolume.new
75
+ volume.to(11) # Set volume to n valid range 0..100
76
+ volume.increment # Increment volume by 1 step
77
+ volume.increment(10) # Increment volume by n steps
78
+ volume.decrement # Decrement volume by 1 step
79
+ volume.decrement(10) # Decrement volume by n steps
80
+ ```
81
+
82
+ ### Mute
83
+
84
+ Enable or disable sound
85
+
86
+ ```ruby
87
+ mute = MusicCast::SetMute.new
88
+ mute.on # Set Mute on
89
+ mute.off # Set Mute off
90
+ ```
37
91
 
38
92
  ## Development
39
93
 
@@ -26,6 +26,7 @@ module MusicCast
26
26
  end
27
27
  end
28
28
 
29
+ require_relative 'api/get_status'
29
30
  require_relative 'api/set_mute'
30
31
  require_relative 'api/set_power'
31
32
  require_relative 'api/set_volume'
@@ -0,0 +1,11 @@
1
+ module MusicCast
2
+ class GetStatus < API
3
+ def to_json
4
+ get.body
5
+ end
6
+
7
+ def get
8
+ make_request('main/getStatus')
9
+ end
10
+ end
11
+ end
@@ -8,6 +8,8 @@ module MusicCast
8
8
  make_request('main/setPower?power=standby')
9
9
  end
10
10
 
11
+ alias_method :off, :standby
12
+
11
13
  def toggle
12
14
  make_request('main/setPower?power=toggle')
13
15
  end
@@ -1,3 +1,3 @@
1
1
  module MusicCast
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: music_cast
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Entwistle
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-25 00:00:00.000000000 Z
11
+ date: 2018-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -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/get_status.rb
135
136
  - lib/music_cast/api/set_mute.rb
136
137
  - lib/music_cast/api/set_power.rb
137
138
  - lib/music_cast/api/set_volume.rb
@@ -158,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
159
  version: '0'
159
160
  requirements: []
160
161
  rubyforge_project:
161
- rubygems_version: 2.7.5
162
+ rubygems_version: 2.7.6
162
163
  signing_key:
163
164
  specification_version: 4
164
165
  summary: Yamaha MusicCast Control System