sonycam 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sonycam/api.rb +1 -1
- data/lib/sonycam/cli.rb +25 -2
- data/lib/sonycam/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28c852472ba2fb6ca1b5e9cab86e394c895a98b6
|
4
|
+
data.tar.gz: 590c2ce724bed81d0dd9b6960e7a0992ef54be0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80f41b1c7cfa0f57745f0f4230cc640ace9893e406645303db70d1839ac4f48b3ec2f45deb4db45658c25fc06ab946257bf042a35873edc4985429cf67c87552
|
7
|
+
data.tar.gz: 5a4dcf499a2a94904f5c8976db8b071e19fd73c35ae869b9533869bbb99544d158a846537ef1f452281e163f34c63abb362cd628685262bbaad6580e955335d7
|
data/lib/sonycam/api.rb
CHANGED
data/lib/sonycam/cli.rb
CHANGED
@@ -7,6 +7,15 @@ module Sonycam
|
|
7
7
|
DD_PATH = File.join(ENV['HOME'], '.sonycam')
|
8
8
|
|
9
9
|
desc 'scan [IP]', 'Discover devices'
|
10
|
+
long_desc <<-LONGDESC
|
11
|
+
Send discovery requests (SSDP M-SEARCH), fetching UPnP device description into `$HOME/.sonycam`.
|
12
|
+
|
13
|
+
A specific IP can be set to bind, for example:
|
14
|
+
|
15
|
+
$ sonycam scan 10.0.0.1
|
16
|
+
|
17
|
+
By default, it binds each local IP address, and uses the first one found.
|
18
|
+
LONGDESC
|
10
19
|
def scan ip = nil
|
11
20
|
location = Scanner.scan(ip).first
|
12
21
|
puts "Found location: #{location}"
|
@@ -14,7 +23,12 @@ module Sonycam
|
|
14
23
|
puts "Device description file saved to #{DD_PATH}"
|
15
24
|
end
|
16
25
|
|
17
|
-
desc 'list [QUERY]', 'List
|
26
|
+
desc 'list [QUERY]', 'List API methods'
|
27
|
+
long_desc <<-LONGDESC
|
28
|
+
List or search available API methods, for example, to search API where name contains "act"
|
29
|
+
|
30
|
+
$ sonycam list act
|
31
|
+
LONGDESC
|
18
32
|
def list query = nil
|
19
33
|
apis = api_client.request(:getAvailableApiList)['result'].first
|
20
34
|
apis.select!{|method| method =~ /#{query}/i } if query
|
@@ -22,8 +36,17 @@ module Sonycam
|
|
22
36
|
end
|
23
37
|
|
24
38
|
desc 'api method [PARAMETER ...]', 'Send API request'
|
39
|
+
long_desc <<-LONGDESC
|
40
|
+
Send a camera API request. Use `sonycam list` to see all available methods.
|
41
|
+
|
42
|
+
Take a picture:
|
43
|
+
\x5$ sonycam api actTakePicture
|
44
|
+
|
45
|
+
Zoom in:
|
46
|
+
\x5$ sonycam api actZoom in start
|
47
|
+
LONGDESC
|
25
48
|
def api method, *params
|
26
|
-
|
49
|
+
puts api_client.request(method, *params).to_json
|
27
50
|
end
|
28
51
|
|
29
52
|
desc 'liveview', 'Start liveview and output to STDOUT, it should be used with pipe'
|
data/lib/sonycam/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sonycam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Jian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|