dacpclient 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/bin/dacpclient +1 -1
- data/dacpclient.gemspec +2 -2
- data/lib/dacpclient/client.rb +12 -16
- data/lib/dacpclient/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20b7236a5ab83767fe89d6cf209479bfcf82a74f
|
4
|
+
data.tar.gz: 3a0efd4010272d54cf56881037302194488529d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4fd7451d4e3a7fe559ba64656388c16ff9cc84aa67a75ba69951adf55ed448b75182d9f0ccfefbe9e068b7ba020b697ff5b123a3f0feff765df8c92bae394d4
|
7
|
+
data.tar.gz: addcdeb4add40740e95c31631cfea95c0d93b0705db10b05bb581f29e35f882521b5e9a102979480466ecf274e1310ba94b0713efcc136588ef3b85405361ac5
|
data/Gemfile
CHANGED
data/bin/dacpclient
CHANGED
@@ -15,7 +15,7 @@ class CLIClient
|
|
15
15
|
|
16
16
|
@client = DACPClient::Client.new(@config['client_name'], 'localhost', 3689)
|
17
17
|
if @config['guid'].nil? || @config['guid'] !~ /^[a-f0-9]{16}$/
|
18
|
-
@config['guid'] = @client.
|
18
|
+
@config['guid'] = @client.guid
|
19
19
|
save_config
|
20
20
|
end
|
21
21
|
@client.guid = @config['guid']
|
data/dacpclient.gemspec
CHANGED
@@ -19,15 +19,15 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
spec.extra_rdoc_files = ['README.md', 'LICENSE']
|
21
21
|
|
22
|
+
spec.add_runtime_dependency 'faraday', '~> 0.9.0'
|
22
23
|
spec.add_runtime_dependency 'dnssd', '~> 2.0'
|
23
|
-
spec.add_runtime_dependency 'faraday', '~> 0.8.8'
|
24
24
|
spec.add_runtime_dependency 'plist', '~> 3.1.0'
|
25
25
|
|
26
26
|
spec.add_development_dependency 'yard'
|
27
27
|
spec.add_development_dependency 'redcarpet'
|
28
28
|
spec.add_development_dependency 'github-markup'
|
29
29
|
spec.add_development_dependency 'minitest', '~> 5.2.0'
|
30
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
30
|
+
spec.add_development_dependency 'rubocop', '~> 0.17.0'
|
31
31
|
spec.add_development_dependency 'rake'
|
32
32
|
|
33
33
|
spec.required_ruby_version = '>= 2.0.0'
|
data/lib/dacpclient/client.rb
CHANGED
@@ -51,7 +51,7 @@ module DACPClient
|
|
51
51
|
@hsgid = response['sgid']
|
52
52
|
end
|
53
53
|
|
54
|
-
def
|
54
|
+
def guid
|
55
55
|
return @guid unless @guid.nil?
|
56
56
|
d = Digest::SHA2.hexdigest(@name)
|
57
57
|
d[0..15]
|
@@ -70,7 +70,7 @@ module DACPClient
|
|
70
70
|
def login
|
71
71
|
response = nil
|
72
72
|
if @hsgid.nil?
|
73
|
-
pairing_guid = '0x' +
|
73
|
+
pairing_guid = '0x' + guid
|
74
74
|
response = do_action(:login, 'pairing-guid' => pairing_guid)
|
75
75
|
else
|
76
76
|
response = do_action(:login, 'hasFP' => '1')
|
@@ -118,12 +118,11 @@ module DACPClient
|
|
118
118
|
do_action(:setproperty, 'dacp.playingtime' => ms)
|
119
119
|
end
|
120
120
|
|
121
|
-
def
|
121
|
+
def position
|
122
122
|
response = do_action(:getproperty, properties: 'dacp.playingtime')
|
123
123
|
response['cast'] - response['cant']
|
124
124
|
end
|
125
125
|
|
126
|
-
alias_method :position, :get_position
|
127
126
|
alias_method :position=, :seek
|
128
127
|
|
129
128
|
def status(wait = false)
|
@@ -149,37 +148,34 @@ module DACPClient
|
|
149
148
|
|
150
149
|
alias_method :previous, :prev
|
151
150
|
|
152
|
-
def
|
151
|
+
def volume
|
153
152
|
response = do_action(:getproperty, properties: 'dmcp.volume')
|
154
153
|
response[:cmvo]
|
155
154
|
end
|
156
155
|
|
157
|
-
def
|
156
|
+
def volume=(volume)
|
158
157
|
do_action(:setproperty, 'dmcp.volume' => volume)
|
159
158
|
end
|
160
159
|
|
161
|
-
|
162
|
-
alias_method :volume=, :set_volume
|
163
|
-
|
164
|
-
def get_repeat
|
160
|
+
def repeat
|
165
161
|
response = do_action(:getproperty, properties: 'dacp.repeatstate')
|
166
162
|
response[:carp]
|
167
163
|
end
|
168
164
|
|
169
|
-
def
|
170
|
-
do_action(:setproperty, '
|
165
|
+
def repeat=(repeatstate)
|
166
|
+
do_action(:setproperty, 'dacp.repeatstate' => repeatstate)
|
171
167
|
end
|
172
168
|
|
173
|
-
def
|
169
|
+
def shuffle
|
174
170
|
response = do_action(:getproperty, properties: 'dmcp.shufflestate')
|
175
171
|
response[:cash]
|
176
172
|
end
|
177
173
|
|
178
|
-
def
|
179
|
-
do_action(:setproperty, 'dmcp.
|
174
|
+
def shuffle=(shufflestate)
|
175
|
+
do_action(:setproperty, 'dmcp.shufflestate' => shufflestate)
|
180
176
|
end
|
181
177
|
|
182
|
-
def
|
178
|
+
def speakers
|
183
179
|
do_action(:getspeakers)
|
184
180
|
end
|
185
181
|
|
data/lib/dacpclient/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dacpclient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jurriaan Pruis
|
@@ -11,33 +11,33 @@ cert_chain: []
|
|
11
11
|
date: 2014-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.9.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.9.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: dnssd
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0
|
33
|
+
version: '2.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0
|
40
|
+
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: plist
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
117
|
+
version: 0.17.0
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.
|
124
|
+
version: 0.17.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rake
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|