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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 90fb4f5958e878b3db469b9ec92124fdba0e0915
4
- data.tar.gz: c39f85d71dddace37cb2c91666523a356920bf1d
3
+ metadata.gz: 28c852472ba2fb6ca1b5e9cab86e394c895a98b6
4
+ data.tar.gz: 590c2ce724bed81d0dd9b6960e7a0992ef54be0b
5
5
  SHA512:
6
- metadata.gz: b4324b2c364f8d4887878e5d6674501cc6f41a7e148aa2db29a775cd13280537c34ff303265c2b3493abb1e0b14620bb1c62202543e295708f7e332296173640
7
- data.tar.gz: 6fc12dcd8b5618e348a261983e202a8677ac33d7f7e91dbe5df6950d3f63535d65a89a22fc14465a88e9663dcb6d7b9a6f0042e02aa7f977bb7ba7ceeaa650a4
6
+ metadata.gz: 80f41b1c7cfa0f57745f0f4230cc640ace9893e406645303db70d1839ac4f48b3ec2f45deb4db45658c25fc06ab946257bf042a35873edc4985429cf67c87552
7
+ data.tar.gz: 5a4dcf499a2a94904f5c8976db8b071e19fd73c35ae869b9533869bbb99544d158a846537ef1f452281e163f34c63abb362cd628685262bbaad6580e955335d7
@@ -16,7 +16,7 @@ module Sonycam
16
16
  error_code, error_message = ret['error']
17
17
  raise Sonycam::Error.new_from_code(error_code), error_message
18
18
  else
19
- ret
19
+ ret['result']
20
20
  end
21
21
  end
22
22
  end
@@ -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 all API or search'
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
- jj api_client.request(method, *params)
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'
@@ -1,3 +1,3 @@
1
1
  module Sonycam
2
- VERSION = '1.1.1'
2
+ VERSION = '1.2.0'
3
3
  end
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.1.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-02 00:00:00.000000000 Z
11
+ date: 2014-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor