remotedroid 0.1.1 → 0.2.0

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: 8182bbf99c5d4129da2c118d695a98ddbe0f11f95912ddd1d5efbf4dd78e1729
4
- data.tar.gz: 773d8738eb35ff52275fc425326a0ebd6cdd43dd209de7090040e1347bfcc463
3
+ metadata.gz: 8301a5580415c8ff56c7234afc06a753f8120a241a6fc55ec21f213d4fb3c547
4
+ data.tar.gz: 582b60289878929ad00789a14f5fe1b709a7642c02a8ef0fd3361d4e32d68e14
5
5
  SHA512:
6
- metadata.gz: 52271972500cd3a2f18da5494247d64e660687188a525f98b929f87c462aaf2296e1d78630c413a13088548261e01034d87df2192d67f461c2b4899284d95c04
7
- data.tar.gz: 6f57080d7164e68ee66db0ef4e864bfdad9a149adef0f7753bbe74d0ccf85929e82d918b458df0423c58a369721c26074be7b0f181e891d0d192737cbb5f1d03
6
+ metadata.gz: c25071dc6b9c5e2089453e0b90b0506d8a1990fe64619437c65642b32150ed50f6ab0ea89d5dfde0a858fe394bd8c804d83ee2acf58c6e04597dc27a807f1360
7
+ data.tar.gz: 373ca3e9621934a9257b89c3bd1d860a86c54921927a2028846577d6a1baa200ca778605d8a9120f59dcae73b0805e13a11205dabc0a3ff743ed6f8a802ddb54
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -31,9 +31,14 @@ require 'ruby-macrodroid'
31
31
  # * Speak text
32
32
  # * Torch toggle
33
33
  #
34
+ # ## Location
35
+ #
36
+ # * Share Location
37
+ #
34
38
  # ## Notification
39
+ #
35
40
  # * Popup Message
36
-
41
+ #
37
42
 
38
43
 
39
44
  RD_MACROS =<<EOF
@@ -61,6 +66,19 @@ v: text
61
66
  t: webhook
62
67
  a: speak text ([lv=text])
63
68
 
69
+ m: Share location
70
+ t:
71
+ WebHook
72
+ identifier: location
73
+ a: Force Location Update
74
+ a:
75
+ Share Location
76
+ coords
77
+ a:
78
+ HTTP GET
79
+ identifier: location
80
+ coords: [lv=coords]
81
+
64
82
  m: shake device
65
83
  t: shake device
66
84
  a: webhook
@@ -336,6 +354,27 @@ module RemoteDroid
336
354
  @model.op
337
355
  end
338
356
 
357
+ def query(trigger)
358
+
359
+ @h[trigger] = nil
360
+
361
+ # send http request via macrodroid.com API
362
+ @control.http_exec trigger
363
+
364
+ # wait for the local variable to be updated
365
+ # timeout after 5 seoncds
366
+ t = Time.now
367
+
368
+ begin
369
+ sleep 1
370
+ end until @h[trigger] or Time.now > t + 5
371
+
372
+ if @h[trigger] then
373
+ yield(@h[trigger])
374
+ end
375
+
376
+ end
377
+
339
378
  def request(s)
340
379
  @model.request s
341
380
  end
@@ -369,6 +408,10 @@ module RemoteDroid
369
408
  end
370
409
 
371
410
  alias trigger_fired trigger
411
+
412
+ def store()
413
+ @h
414
+ end
372
415
 
373
416
  end
374
417
 
@@ -429,12 +472,20 @@ module RemoteDroid
429
472
 
430
473
  end
431
474
 
475
+ def location(options={})
476
+ http_exec 'location'
477
+ end
478
+
432
479
  def say_current_time(options={})
433
480
  http_exec 'say-current-time'
434
481
  end
435
482
 
436
483
  alias say_time say_current_time
437
484
 
485
+ def share_location(options={})
486
+ http_exec 'share-location'
487
+ end
488
+
438
489
  def speak_text(options={})
439
490
  http_exec 'speak-text', options
440
491
  end
@@ -447,6 +498,7 @@ module RemoteDroid
447
498
  http_exec :torch
448
499
  end
449
500
 
501
+
450
502
  def write(s)
451
503
 
452
504
  MacroDroid.new(RD_MACROS, deviceid: @deviceid,
@@ -478,6 +530,22 @@ module RemoteDroid
478
530
 
479
531
  end
480
532
 
533
+ class Client
534
+
535
+ def initialize(host='127.0.0.1')
536
+ @drb = OneDrb::Client.new host: host, port: '5777'
537
+ end
538
+
539
+ def export(s)
540
+ @drb.export(s)
541
+ end
542
+
543
+ def invoke(s, *args)
544
+ @drb.invoke(s, *args)
545
+ end
546
+
547
+ end
548
+
481
549
  class TriggerSubscriber < SPSSub
482
550
 
483
551
  def initialize(host: 'sps.home', drb_host: '127.0.0.1')
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.1.1
4
+ version: 0.2.0
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-03 00:00:00.000000000 Z
38
+ date: 2020-10-06 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: onedrb
@@ -103,20 +103,20 @@ dependencies:
103
103
  requirements:
104
104
  - - "~>"
105
105
  - !ruby/object:Gem::Version
106
- version: '0.8'
106
+ version: '0.9'
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
- version: 0.8.12
109
+ version: 0.9.2
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '0.8'
116
+ version: '0.9'
117
117
  - - ">="
118
118
  - !ruby/object:Gem::Version
119
- version: 0.8.12
119
+ version: 0.9.2
120
120
  description:
121
121
  email: james@jamesrobertson.eu
122
122
  executables: []
metadata.gz.sig CHANGED
Binary file