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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/humble_rpi-plugin-led.rb +9 -9
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 504a177d097dedb367b77257648c3f81a1a927f7
|
4
|
+
data.tar.gz: 3c97a67ec27cf379108d7b8bc6de9d174afc21c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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!(
|
45
|
-
@lookup.merge!(led_name.to_sym =>
|
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
metadata.gz.sig
CHANGED
Binary file
|