cheeky-pi 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -4
- data/lib/cheeky-pi/animation/base.rb +1 -1
- data/lib/cheeky-pi/light.rb +3 -3
- data/lib/cheeky-pi/version.rb +1 -1
- metadata +3 -2
data/README.md
CHANGED
@@ -32,8 +32,9 @@ EventMachine.run {
|
|
32
32
|
### Multiple lights:
|
33
33
|
|
34
34
|
```ruby
|
35
|
-
|
36
|
-
|
35
|
+
pi = CheekyPi.new
|
36
|
+
light1 = pi.lights[0]
|
37
|
+
light2 = pi.lights[1]
|
37
38
|
...
|
38
39
|
light1.failure
|
39
40
|
light2.success
|
@@ -52,7 +53,7 @@ CheekyPi.new.light.transition! [255, 0, 255]
|
|
52
53
|
CheekyPi.new.light.throb! [0, 255, 0], [0, 0, 255], 10
|
53
54
|
```
|
54
55
|
|
55
|
-
|
56
|
+
### Fun with promises
|
56
57
|
|
57
58
|
```ruby
|
58
59
|
light = CheekyPi.new.light
|
@@ -87,4 +88,4 @@ end
|
|
87
88
|
My raspberry pi could not interact with the webmail notifier via libusb, so this gem depends instead on
|
88
89
|
`/sys/devices/*/red|green|blue` courtesy of the usbled driver.
|
89
90
|
|
90
|
-
Additionally, I wanted (non-blocking) animation for use with a build monitoring tool.
|
91
|
+
Additionally, I wanted (non-blocking) animation for use with a build monitoring tool.
|
data/lib/cheeky-pi/light.rb
CHANGED
@@ -27,8 +27,8 @@ module CheekyPi
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def building
|
30
|
-
start_color = [
|
31
|
-
end_color = [
|
30
|
+
start_color = [5, 5, 25]
|
31
|
+
end_color = [10, 15, MAX]
|
32
32
|
|
33
33
|
transition!(start_color).then do
|
34
34
|
throb!(3, start_color, end_color)
|
@@ -37,7 +37,7 @@ module CheekyPi
|
|
37
37
|
|
38
38
|
def failure
|
39
39
|
start_color = [30, 0, 0]
|
40
|
-
end_color = [MAX,
|
40
|
+
end_color = [MAX, 25, 5]
|
41
41
|
|
42
42
|
transition!(start_color).then do
|
43
43
|
throb!(1, start_color, end_color)
|
data/lib/cheeky-pi/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cheeky-pi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -43,7 +43,8 @@ dependencies:
|
|
43
43
|
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: 1.1.1
|
46
|
-
description:
|
46
|
+
description: EventMachine-friendly library for working with the DreamCheeky Webmail
|
47
|
+
Notifier.
|
47
48
|
email: billiamthesecond@gmail.com
|
48
49
|
executables: []
|
49
50
|
extensions: []
|