humble_rpi-plugin-led 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8ada755e047f52911a4d2709fe123bfdcde20c9
4
- data.tar.gz: 6915c66dc6a0159b8d662eba3b439ebd917999ab
3
+ metadata.gz: 504a177d097dedb367b77257648c3f81a1a927f7
4
+ data.tar.gz: 3c97a67ec27cf379108d7b8bc6de9d174afc21c0
5
5
  SHA512:
6
- metadata.gz: d36181b258edd33393f66cb46043cf47f9524bb3e51112bbabc668fc05ea3911cb4b11c7b8c2c577569407b08873548029ff1f3b654c591cb63d14dcb12f04a8
7
- data.tar.gz: 0ed31ca0e49dd09d290aec17cb109c0145e03f6657a0b0b873d5d86d37b5b81813dacc15c9b5bb7b36f6faabc863ff7e4e563d00b5ad94f741a0c1740044ac26
6
+ metadata.gz: 8740654e5ed3df3e8864cb1e2f1262121617cf833b04fcbea426f72bf2b0b4bdc537a79d7b06d715ad09c54d0d3be9cf132b235cb09d5c30988f330f48e56f8e
7
+ data.tar.gz: 445c382bd7b84be389e847b7b70a7f366a97072f61bf5cc6bf349be278933cc901c3228d692568b1e491e8200a6466ea5b1f1d0fbeca6bef688a33b05ca8eac1
checksums.yaml.gz.sig CHANGED
Binary file
@@ -29,24 +29,24 @@ class HumbleRPiPluginLed
29
29
  # each pin can contain an identifier e.g. pins = [{'4': 'record'}, 17]
30
30
  # an LED can be identified by the identifier instead of the numberic index
31
31
 
32
- pins.each do |x|
33
-
34
- if x.is_a? Integer then
32
+ pins.each.with_index do |x, i|
33
+
34
+ if x.is_a? String or x.is_a? Integer then
35
35
 
36
- @lookup.merge!(x.to_s.to_sym => x )
37
- @gpio_pins << x
36
+ @lookup.merge!(x.to_s.to_sym => x.to_s )
37
+ @gpio_pins << x.to_s
38
38
 
39
39
  elsif x.is_a? Hash
40
40
 
41
41
  n = x.keys.first.to_s
42
42
 
43
43
  led_name = x[n.to_sym]
44
- @lookup.merge!(n.to_sym => n.to_i )
45
- @lookup.merge!(led_name.to_sym => n.to_i )
44
+ @lookup.merge!(i.to_s.to_sym => i )
45
+ @lookup.merge!(led_name.to_sym => i )
46
46
  @gpio_pins << n.to_i
47
47
  end
48
48
 
49
- end
49
+ end
50
50
 
51
51
  end
52
52
 
@@ -71,7 +71,7 @@ class HumbleRPiPluginLed
71
71
  [:blink, seconds, duration: duration]
72
72
  end
73
73
 
74
- @led[@lookup[index].to_i].send(*a)
74
+ @led[@lookup[index.to_sym].to_i].send(*a)
75
75
  end
76
76
  end
77
77
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: humble_rpi-plugin-led
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file