remotedroid 0.4.2 → 0.4.3

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: 6bd8aa94326f04e26626c2919060c259afea85c5e89f6ae33de505d0af5381b6
4
- data.tar.gz: efbb77b568cc56a821569021dfd6a1c4001645a0019d0d3d56445a3f31887737
3
+ metadata.gz: 93065c866dfef9501613644d3f1ec4f18fd7ba5459c62645eb97bbdfb6069b89
4
+ data.tar.gz: 8ae132d997c1c7072383eb6878e757bbcc7deeb1241d783d261a2d4885bd0c42
5
5
  SHA512:
6
- metadata.gz: 68ca84c69885979de74d5265b216808dba934f63854978ffde5e48a49458f88e3483294f555f36685b1a5cc44b2309b285870228c5eb63ca3759b0e41eb7b752
7
- data.tar.gz: ba2aa7d3d3fbf3512b3cfdbd55aa7442499355c3110bcfed6b92a5da516f4a4e39eb3ff8eff6fba5f3702aeb739562d2bde777c31e2c0ce6a9a9581287fda93f
6
+ metadata.gz: 548cc195f2f8525be869c8429dbb1ede8c9da42ba3ff489b347b204f2bdcb630e09b5d012b4c496ff49bcd2ec6d94bccfc968ff9d4cfbe4d057186bc6209d991
7
+ data.tar.gz: 5b5eff2de32dfe89a2110558bce22e1a11ddf4cc6ed9d69e903b6c087575e5a9e48e20fbea39a95eade2d69e67b6d49db7ae68874e947aa93ae4a8896852cbf6
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -13,6 +13,10 @@ require 'ruby-macrodroid'
13
13
  #
14
14
  # # Triggers
15
15
  #
16
+ # ## Device Events
17
+ #
18
+ # * screen on
19
+ #
16
20
  # ## Sensors
17
21
  #
18
22
  # * proximity (near)
@@ -22,7 +26,11 @@ require 'ruby-macrodroid'
22
26
  #
23
27
  # # Actions
24
28
  #
25
- ## Connectivity
29
+ # ## Camera/Photo
30
+ #
31
+ # * Take Picture
32
+ #
33
+ # ## Connectivity
26
34
  #
27
35
  # * Enable HotSpot
28
36
  #
@@ -152,7 +160,12 @@ a:
152
160
  Disable Hotspot
153
161
  End If
154
162
 
155
-
163
+ m: Take Picture
164
+ t: webhook
165
+ a:
166
+ Take Picture
167
+ Rear Facing
168
+
156
169
  m: Share location
157
170
  t:
158
171
  WebHook
@@ -222,7 +235,10 @@ a:
222
235
  m: Power connected
223
236
  t: Power Connected: Any
224
237
  a: webhook
225
-
238
+
239
+ m: screen on off
240
+ t: screen on
241
+ a: webhook
226
242
 
227
243
  EOF
228
244
 
@@ -731,6 +747,13 @@ module RemoteDroid
731
747
  end
732
748
 
733
749
  alias say speak_text
750
+
751
+ def take_picture(options={})
752
+ http_exec :'take-picture', options
753
+ end
754
+
755
+ alias take_photo take_picture
756
+
734
757
 
735
758
  def toast(options={})
736
759
  http_exec :toast, options
@@ -872,6 +895,10 @@ module RemoteDroid
872
895
  query.location
873
896
  end
874
897
 
898
+ def photo()
899
+ take_picture
900
+ end
901
+
875
902
  def say(text)
876
903
  control.speak_text text
877
904
  end
@@ -894,6 +921,31 @@ module RemoteDroid
894
921
  screen :off
895
922
  end
896
923
 
924
+ def take_picture(ftp_src: nil, fileout: '.')
925
+
926
+ screen.on
927
+ r = control.take_picture
928
+
929
+ if ftp_src then
930
+
931
+ # the sleep statement will be replaced in the near future,
932
+ # but it's fine to demonstrate it works
933
+ sleep 8
934
+
935
+ credentials, dir = ftp_src.match(/(ftp:\/\/[^\/]+)\/([^$]+)/).captures
936
+ ftp = MyMediaFTP.new(credentials)
937
+ ftp.cd dir
938
+ filename = ftp.ls.sort_by {|x| x[:ctime]}.last[:name]
939
+ ftp.cp filename, fileout
940
+
941
+ end
942
+
943
+ end
944
+
945
+ def take_photo()
946
+ control.take_photo
947
+ end
948
+
897
949
  def torch()
898
950
  control.torch
899
951
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remotedroid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  io3WPRDjULC924M5S8wbrus31v2AUjqFBPvmHr7caf/VHErWypV482xcDhWt1eif
36
36
  0G2k2ptozXcBS9odsqGUTb5N
37
37
  -----END CERTIFICATE-----
38
- date: 2020-10-14 00:00:00.000000000 Z
38
+ date: 2020-10-16 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: onedrb
metadata.gz.sig CHANGED
Binary file