remotedroid 0.5.2 → 0.5.3

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: 99592d4ac1baaef0d04b87d8bb9dd6cfcbdfc5572dacc39c6fabbd5a960f85f3
4
- data.tar.gz: a5fbd36d797423dd183dccbb2351736ac58f706acf3b88932ae737d43e55a8e9
3
+ metadata.gz: df5d8ff42bcaa56e29104adb4e802afc9fea9df24e54e3861268f8120c59d754
4
+ data.tar.gz: 83c8653599215e33d641b414fc6dcfa4a7ad1711b462d098ccf8dbbcd654001c
5
5
  SHA512:
6
- metadata.gz: 893732ed1fb124c982bdcd6b55d4d2f54acd9a32256d707cde13a13d86fb9547a9b126ab6200b98ed211ae739cf42e95136c5fe444fbd435646607b6e8fda9a7
7
- data.tar.gz: a651dd655ab1dcb59549d7abd5d32a948f4fbf04ec134f9c35ff104ff7f9def9308a8f8acf9751e7cefa27e7ca4517af7e310a5603de6ab6a196271a1ca54b5c
6
+ metadata.gz: 2808afc3086dac37cf72544b2445ebe7b0dbcea42709a318e7b08c3da683f8353b893ea8048d05c69c0ddc78e7456e2f644a0bf158212335e150178b5bed16c2
7
+ data.tar.gz: d5852dade61330d9c16f498750f76100cd6517f51e04eef403945719031726a161ea610a3133b0e755c2e599068d3af0787515d4f63039ec34bf7f40da309d5c
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -197,6 +197,47 @@ m: stay awake off
197
197
  t: webhook
198
198
  a: stay awake off
199
199
 
200
+ m: Launch Google Play Music
201
+ t: webhook
202
+ a: Launch Google Play Music
203
+
204
+
205
+ m: Media Next
206
+ t: webhook
207
+ a:
208
+ Media Next
209
+ Simulate Media Button (Google Play Music)
210
+
211
+ m: Media Pause
212
+ t: webhook
213
+ a:
214
+ Media Pause
215
+ Simulate Media Button (Google Play Music)
216
+
217
+ m: Media Play
218
+ t: webhook
219
+ a:
220
+ Media Play
221
+ Simulate Media Button (Google Play Music)
222
+
223
+ m: Media Play Pause
224
+ t: webhook
225
+ a:
226
+ Media Play/Pause
227
+ Simulate Media Button (Google Play Music)
228
+
229
+ m: Media Previous
230
+ t: webhook
231
+ a:
232
+ Media Previous
233
+ Simulate Media Button (Google Play Music)
234
+
235
+ m: Media Stop
236
+ t: webhook
237
+ a:
238
+ Media Stop
239
+ Simulate Media Button (Google Play Music)
240
+
200
241
  m: Share location
201
242
  t:
202
243
  WebHook
@@ -276,9 +317,12 @@ m: Power connected
276
317
  t: Power Connected: Any
277
318
  a: webhook
278
319
 
279
- m: screen on off
320
+ m: Screen on
280
321
  t: screen on
281
- a: webhook
322
+ a:
323
+ webhook
324
+ identifier: screen_on_off
325
+ screen_on: true
282
326
 
283
327
  m: Power Button Toggle3
284
328
  t: Power Button Toggle (3)
@@ -421,15 +465,8 @@ a:
421
465
  identifier: flip_device
422
466
  facedown: false
423
467
  EOF
424
- s="
425
-
426
468
 
427
469
 
428
-
429
-
430
-
431
- "
432
-
433
470
  module RemoteDroid
434
471
 
435
472
  class Server
@@ -483,18 +520,17 @@ module RemoteDroid
483
520
  context, json = msg.split(/:\s+/,2)
484
521
  category, action = context.split('/',2)
485
522
 
486
- if action == 'force_macro_run' then
523
+ h = JSON.parse(json, symbolize_names: true)
524
+
525
+ if action == 'force_macro_run' and h[:serverside] then
487
526
 
488
- self.notice 'macrodroid2: fmr'
489
- a = @remote.run_macro(JSON.parse(json, symbolize_names: true))
490
-
491
- a.each do |msg|
492
- self.notice 'macrodroid/action: ' + msg
493
- end
527
+ a = @remote.run_macro(h)
528
+ a.each {|msg| self.notice 'macrodroid/action: ' + msg }
494
529
 
495
530
  else
496
- @remote.control.method(action.to_sym)\
497
- .call(JSON.parse(json, symbolize_names: true))
531
+
532
+ @remote.control.method(action.to_sym).call(h)
533
+
498
534
  end
499
535
 
500
536
  end
@@ -60,6 +60,10 @@ module RemoteDroid
60
60
  query.cell_tower
61
61
  end
62
62
 
63
+ def control_media(option='Play/Pause')
64
+ control.control_media({option: option})
65
+ end
66
+
63
67
  def disable(macro)
64
68
  control.disable macro
65
69
  end
@@ -70,7 +74,13 @@ module RemoteDroid
70
74
 
71
75
  def hotspot(state=nil)
72
76
  control.hotspot state
73
- end
77
+ end
78
+
79
+ def launch_activity(app='')
80
+ control.launch_activity(app)
81
+ end
82
+
83
+ alias launch launch_activity
74
84
 
75
85
  def location()
76
86
  query.location
@@ -98,11 +108,31 @@ module RemoteDroid
98
108
  end
99
109
 
100
110
  end
111
+
112
+ def next()
113
+ control_media(option='Next')
114
+ end
115
+
116
+ def pause()
117
+ control_media(option='Pause')
118
+ end
119
+
120
+ def play()
121
+ control_media(option='Play')
122
+ end
123
+
124
+ def play_pause()
125
+ control_media(option='Play/Pause')
126
+ end
101
127
 
102
128
  def photo()
103
129
  take_picture
104
130
  end
105
131
 
132
+ def previous()
133
+ control_media(option='Previous')
134
+ end
135
+
106
136
  def say(text)
107
137
  control.speak_text text
108
138
  end
@@ -133,6 +163,10 @@ module RemoteDroid
133
163
  control.stay_awake_off
134
164
  end
135
165
 
166
+ def stop()
167
+ control_media(option='Stop')
168
+ end
169
+
136
170
  def take_picture(ftp_src: nil, fileout: '.')
137
171
 
138
172
  #screen.on
@@ -16,13 +16,21 @@ module RemoteDroid
16
16
  http_exec 'camera-flash-light', options
17
17
  end
18
18
 
19
+ def control_media(options={})
20
+ http_exec 'media-' + options[:option].downcase.gsub(/\W/,'-')
21
+ end
22
+
19
23
  def disable(macro)
20
24
  http_exec 'disable-macro', {name: macro}
21
25
  end
22
26
 
23
27
  def enable(macro)
24
28
  http_exec 'enable-macro', {name: macro}
25
- end
29
+ end
30
+
31
+ def force_macro_run(options={})
32
+ http_exec option[:macro_name].downcase.gsub(/ /,'-')
33
+ end
26
34
 
27
35
  def hotspot(state=nil)
28
36
 
@@ -65,6 +73,11 @@ module RemoteDroid
65
73
 
66
74
  end
67
75
 
76
+ def launch_activity(options={})
77
+ app = options[:app].downcase.gsub(/ /,'-')
78
+ http_exec 'launch-' + app
79
+ end
80
+
68
81
  def location(options={})
69
82
  http_exec 'location'
70
83
  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.5.2
4
+ version: 0.5.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-21 00:00:00.000000000 Z
38
+ date: 2020-10-22 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: onedrb
metadata.gz.sig CHANGED
Binary file