ruby-macrodroid 0.9.14 → 0.9.15

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: d2421b1c983ef4223a4e461f70a37be3fa3d2200141ada22a535813b8b9ea94d
4
- data.tar.gz: cf6a20994ba0a24ca544a1b8bfb75ffab22b6022be1a1f71e4e73b3a344b39e7
3
+ metadata.gz: 3ee2f540a744e2a309b3e4306a3f75c9ac3f437ebb9907d6f98cc39ea9b873fb
4
+ data.tar.gz: 1f8f909bcd280c7fabe301d8cbb3c8535d56901bb7986224cc0d046cccb3b61b
5
5
  SHA512:
6
- metadata.gz: b88c007520adab8bf80f1c0723d803ac2561092c450aee86f2d0e8e26a322646f15dc5df5d9419d1524f8339f0e85a332b603c65124bdb1eebf66b741ca7b1aa
7
- data.tar.gz: 9ab6f2170600df9813114f9513b1e490496db70a82d432c2e3a3bad2768a67dfe27d7bb0ce84a38c80e28bf4e3a26ed4f8e92f788b1a2bc4c23884fc816a3571
6
+ metadata.gz: 045fb9a42206777def57c23a89ec1aaccb2dac969b44f2b0fc388885e14a7ce8c1a6f093451237dcbfe8e2287cc3395033506853da6dca94706e368704df66ae
7
+ data.tar.gz: fc65220be3fd9e7265b6bfcdf194735c831e02fcb3b6c8e158d6e24cde83cbbbcfbb1547cd4932a0a96ba79f552d9134690dc1e91fdd0405751a6d6c41e382f9
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -32,6 +32,30 @@
32
32
  #
33
33
 
34
34
 
35
+ APPS = {
36
+ 'AutoBoy' => 'com.happyconz.blackbox',
37
+ 'Amazon Alexa' => 'com.amazon.dee.app',
38
+ 'Brave' => 'com.brave.browser',
39
+ 'Camera' => 'com.google.android.camera',
40
+ 'Cast to TV' => 'cast.video.screenmirroring.casttotv',
41
+ 'File Manager' => 'com.alphainventor.filemanager',
42
+ 'Firefox' => 'org.mozilla.firefox',
43
+ 'Google Chrome' => 'com.google.android.chrome',
44
+ 'Chrome' => 'com.google.android.chrome',
45
+ 'Google Home' => 'com.google.android.apps.chromecast.app',
46
+ 'Google Play Music' => 'com.google.android.music',
47
+ 'MacroDroid' => 'com.arlosoft.macrodroid',
48
+ 'QuickEdit Text Editor Pro' => 'com.rhmsoft.edit.pro',
49
+ 'QR & Barcode Reader' => 'com.teacapps.barcodescanner',
50
+ 'Settings' => 'com.google.android.settings',
51
+ 'tinyCam PRO' => 'com.alexvas.dvr.pro',
52
+ 'Tor Browser' => 'org.torproject.torbrowser',
53
+ 'VLC' => 'org.videolan.vlc',
54
+ 'WiFi FTP Server' => 'com.medhaapps.wififtpserver',
55
+ 'YouTube' => 'com.google.android.youtube'
56
+ }
57
+
58
+
35
59
  class Action < MacroObject
36
60
  using ColouredText
37
61
  using Params
@@ -2022,6 +2046,62 @@ end
2022
2046
 
2023
2047
  # Category: Media
2024
2048
  #
2049
+
2050
+
2051
+ # note: to find a package id from an App name, try searching for the name on
2052
+ # the Google Play Store and the id will be returned in the URL once the
2053
+ # correct app has been clicked. e.g.
2054
+ # https://play.google.com/store/apps/details?id=com.google.android.music
2055
+ #
2056
+ class ControlMediaAction < MediaAction
2057
+
2058
+ def initialize(obj=nil)
2059
+
2060
+ h = if obj.is_a? Hash then
2061
+ obj
2062
+ elsif obj.is_a? Array
2063
+
2064
+ e, macro = obj
2065
+ s = e.text('item/description').to_s
2066
+ app = s[/Simulate Media Button \(([^\)]+)/,1]
2067
+
2068
+ if app then
2069
+
2070
+ {
2071
+ application_name: app, package_name: APPS[app],
2072
+ simulate_media_button: true
2073
+ }
2074
+
2075
+ else
2076
+ {}
2077
+ end
2078
+ end
2079
+
2080
+ options = {
2081
+ application_name: "Google Play Music", option: "Play/Pause",
2082
+ package_name: "com.google.android.music",
2083
+ send_media_player_commands: false,
2084
+ simulate_media_button: true,
2085
+ }
2086
+
2087
+ super(options.merge h)
2088
+
2089
+ end
2090
+
2091
+ def to_s(colour: false, indent: 0)
2092
+
2093
+ @s = 'Media ' + @h[:option] #+ @h.inspect
2094
+
2095
+ if @h[:simulate_media_button] then
2096
+ @s += "\nSimulate Media Button (%s)" % @h[:application_name]
2097
+ end
2098
+
2099
+ super()
2100
+ end
2101
+
2102
+ alias to_summary to_s
2103
+ end
2104
+
2025
2105
  class RecordMicrophoneAction < MediaAction
2026
2106
 
2027
2107
  def initialize(h={})
@@ -134,9 +134,11 @@ class ActionsNlp
134
134
  # e.g. Launch Settings
135
135
  get /^Launch (.*)$/i do |application|
136
136
 
137
+ app = APPS[application] || 'com.android.' + application.downcase.split()\
138
+ .join('.')
137
139
  h = {
138
140
  application_name: application,
139
- package_to_launch: 'com.android.' + application.downcase
141
+ package_to_launch: app
140
142
  }
141
143
  [LaunchActivityAction, h]
142
144
 
@@ -238,6 +240,14 @@ class ActionsNlp
238
240
  [PauseAction, {delay_in_seconds: seconds.to_i}]
239
241
  end
240
242
 
243
+ ## -- Media -----------------------------------------
244
+ #
245
+ # options: Play/Pause, Previous, Next, Play, Pause, Stop
246
+ #
247
+ get /^Media ([^$]+)$/i do |option|
248
+ [ControlMediaAction, {option: option}]
249
+ end
250
+
241
251
  # -- Screen ------------------------------------------------
242
252
  #
243
253
  get /^Screen (On|Off)$/i do |state|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-macrodroid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.14
4
+ version: 0.9.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  NZ2kdBIUDnAM24e0/wXdVxg4HnsZbdymxyzMQ4P5pKYcpI6oisBxI37p/Xy+wAg3
36
36
  SBHno3GEuuD8ZWj24IMJpfbp
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: glw
metadata.gz.sig CHANGED
Binary file