remotedroid 0.4.3 → 0.4.4

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: 93065c866dfef9501613644d3f1ec4f18fd7ba5459c62645eb97bbdfb6069b89
4
- data.tar.gz: 8ae132d997c1c7072383eb6878e757bbcc7deeb1241d783d261a2d4885bd0c42
3
+ metadata.gz: 4599f668ded4ccead69bcab55ac94e081027b1054b4053ee2cb2f142303a7b01
4
+ data.tar.gz: cdbcb98bab0dd3df0d8252892ce5c44c7ed26332803a89292357b04f2f26a9e4
5
5
  SHA512:
6
- metadata.gz: 548cc195f2f8525be869c8429dbb1ede8c9da42ba3ff489b347b204f2bdcb630e09b5d012b4c496ff49bcd2ec6d94bccfc968ff9d4cfbe4d057186bc6209d991
7
- data.tar.gz: 5b5eff2de32dfe89a2110558bce22e1a11ddf4cc6ed9d69e903b6c087575e5a9e48e20fbea39a95eade2d69e67b6d49db7ae68874e947aa93ae4a8896852cbf6
6
+ metadata.gz: 636856536a64d87445c01d3e2b320ccf0fbfed713a6ba4384a19947b182f33bee281a6ae1e191237ed5f74e0995c6460f21108cb4a578b6ea406ecab0921b0c9
7
+ data.tar.gz: a650ca4d116ccba5251cd1e9f489587d8ebd5f33c7e8c106a8e59c0817187511d26d2d01aac92d88b27ee0efb07b9cad9eb4a6d7da0abace184f174550a3762e
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -58,6 +58,7 @@ require 'ruby-macrodroid'
58
58
  #
59
59
  # ## Screen
60
60
  #
61
+ # * Keep Device Awake
61
62
  # * Screen On
62
63
  #
63
64
 
@@ -165,6 +166,16 @@ t: webhook
165
166
  a:
166
167
  Take Picture
167
168
  Rear Facing
169
+ a: wait 2 seconds
170
+ a: webhook
171
+
172
+ m: stay awake
173
+ t: webhook
174
+ a: stay awake
175
+
176
+ m: stay awake off
177
+ t: webhook
178
+ a: stay awake off
168
179
 
169
180
  m: Share location
170
181
  t:
@@ -549,6 +560,8 @@ module RemoteDroid
549
560
  @control.http_exec :'query-setting-global', {qvar: id}
550
561
  elsif secure.include? id
551
562
  @control.http_exec :'query-setting-secure', {qvar: id}
563
+ elsif id.downcase.to_sym == :'take-picture'
564
+ @control.http_exec id
552
565
  else
553
566
  @control.http_exec :query, {qvar: id}
554
567
  end
@@ -559,7 +572,7 @@ module RemoteDroid
559
572
 
560
573
  begin
561
574
  sleep 1
562
- end until @store[id] or Time.now > t + 5
575
+ end until @store[id] or Time.now > t + 10
563
576
 
564
577
  return {warning: 'HTTP response timeout'} if Time.now > t+5
565
578
 
@@ -603,11 +616,16 @@ module RemoteDroid
603
616
  alias trigger_fired trigger
604
617
 
605
618
  def update(id, val)
606
- key = id == :location ? id : val.keys.first.to_sym
619
+
620
+ key = if %i(location take-picture).include? id
621
+ id
622
+ else
623
+ val.keys.first.to_sym
624
+ end
625
+
607
626
  @store[key] = val
608
627
  end
609
628
 
610
-
611
629
  end
612
630
 
613
631
  class Service
@@ -747,9 +765,17 @@ module RemoteDroid
747
765
  end
748
766
 
749
767
  alias say speak_text
768
+
769
+ def stay_awake(options={})
770
+ http_exec 'stay-awake', options
771
+ end
750
772
 
773
+ def stay_awake_off(options={})
774
+ http_exec 'stay-awake-off', options
775
+ end
776
+
751
777
  def take_picture(options={})
752
- http_exec :'take-picture', options
778
+ http_exec 'take-picture', options
753
779
  end
754
780
 
755
781
  alias take_photo take_picture
@@ -817,6 +843,9 @@ module RemoteDroid
817
843
  @callback.query(:location)[:coords]
818
844
  end
819
845
 
846
+ def take_picture()
847
+ @callback.query(:'take-picture')
848
+ end
820
849
 
821
850
  private
822
851
 
@@ -921,16 +950,24 @@ module RemoteDroid
921
950
  screen :off
922
951
  end
923
952
 
953
+ def stay_awake()
954
+ control.stay_awake
955
+ end
956
+
957
+ def stay_awake_off()
958
+ control.stay_awake_off
959
+ end
960
+
924
961
  def take_picture(ftp_src: nil, fileout: '.')
925
962
 
926
- screen.on
927
- r = control.take_picture
963
+ #screen.on
964
+ r = query.take_picture
928
965
 
929
966
  if ftp_src then
930
967
 
931
968
  # the sleep statement will be replaced in the near future,
932
969
  # but it's fine to demonstrate it works
933
- sleep 8
970
+ #sleep 8
934
971
 
935
972
  credentials, dir = ftp_src.match(/(ftp:\/\/[^\/]+)\/([^$]+)/).captures
936
973
  ftp = MyMediaFTP.new(credentials)
@@ -942,9 +979,7 @@ module RemoteDroid
942
979
 
943
980
  end
944
981
 
945
- def take_photo()
946
- control.take_photo
947
- end
982
+ alias take_photo take_picture
948
983
 
949
984
  def torch()
950
985
  control.torch
@@ -1011,6 +1046,7 @@ module RemoteDroid
1011
1046
  super(topic: topic) do |msg|
1012
1047
 
1013
1048
  json, id = msg.split(/:\s+/,2).reverse
1049
+
1014
1050
  h = JSON.parse(json, symbolize_names: true)
1015
1051
  id ||= h.keys.first
1016
1052
  @remote.update id.to_sym, h
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.3
4
+ version: 0.4.4
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-16 00:00:00.000000000 Z
38
+ date: 2020-10-17 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: onedrb
metadata.gz.sig CHANGED
Binary file