ruby-macrodroid 0.9.1 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -244,7 +244,7 @@ class ExternalPowerTrigger < Trigger
244
244
 
245
245
  return 'Power Disconnected' unless @h[:power_connected]
246
246
 
247
- status = 'Power Connectd'
247
+ status = 'Power Connected'
248
248
  options = if @h[:power_connected_options].all? then
249
249
  'Any'
250
250
  else
@@ -421,27 +421,33 @@ class WebHookTrigger < Trigger
421
421
  h = if obj.is_a? Hash then
422
422
  obj
423
423
  elsif obj.is_a? Array
424
+
424
425
  e, macro = obj
425
426
  txt = e.text('item/description')
426
- {url: (txt || e.text), macro: macro}
427
+
428
+ h2 = if txt then
429
+ {url: (txt || e.text)}
430
+ else
431
+ a = e.xpath('item/*')
432
+ a.map {|node| [node.name.to_sym, node.text.to_s]}.to_h
433
+ end
434
+
435
+ h2.merge(macro: macro)
427
436
  end
428
437
 
429
438
  if h[:url] then
430
- h[:identifier] = h[:url][/https:\/\/trigger.macrodroid.com\/(?:\w+\-){4}\w+\/([^$]+)/,1]
439
+ h[:identifier] = h[:url]\
440
+ [/https:\/\/trigger.macrodroid.com\/(?:\w+\-){4}\w+\/([^$]+)/,1]
441
+ elsif h[:identifier].nil? or h[:identifier].empty? then
442
+ h[:identifier] = h[:macro].title.downcase.gsub(/ +/,'-')
431
443
  end
432
444
 
433
-
434
445
  options = {
435
446
  identifier: ''
436
447
  }
437
448
 
438
449
  @deviceid = h[:macro].deviceid
439
-
440
-
441
- if h[:identifier].nil? or h[:identifier].empty? then
442
- h[:identifier] = h[:macro].title.downcase.gsub(/ +/,'-')
443
- end
444
-
450
+
445
451
  super(options.merge filter(options,h))
446
452
  @list << 'identifier'
447
453
 
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.1
4
+ version: 0.9.6
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-03 00:00:00.000000000 Z
38
+ date: 2020-10-13 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: glw
metadata.gz.sig CHANGED
Binary file