humble_rpi 0.1.5 → 0.2.2
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/humble_rpi.rb +13 -3
- metadata +26 -5
- 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: 263b2b7ceee9abc1a2b669b2d04e1e4df856c1c2
|
4
|
+
data.tar.gz: 548033ff364c56c91a778135df689eca46169147
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83ff7214759ee101e4600e591cad10f052fe29b0ab69242f57a16d2e3988eac8907e8c456854b0ea07f2c289bc80741eb01ed7921689bcd5416b9b837b751239
|
7
|
+
data.tar.gz: 7c1ee1bb1a5165694730684bd869082914c841cee3737465dd7265d259347f05c0d2a5e78853e3ce47729f9e4d4dfdb5b3084fb58f9e3f804cec1906d32d600a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/humble_rpi.rb
CHANGED
@@ -5,15 +5,19 @@
|
|
5
5
|
require 'rpi'
|
6
6
|
require 'chronic_duration'
|
7
7
|
require 'sps-pub'
|
8
|
+
require 'rpi_lcd16x2'
|
8
9
|
|
9
10
|
|
10
|
-
class HumbleRPi
|
11
|
+
class HumbleRPi
|
11
12
|
include PiPiper
|
12
13
|
|
14
|
+
attr_reader :led, :lcd
|
15
|
+
|
13
16
|
def initialize(options={})
|
14
17
|
|
15
18
|
default_options = {
|
16
19
|
device_name: 'rpi',
|
20
|
+
lcd_pins: {},
|
17
21
|
led_pins: [],
|
18
22
|
motion_pin: nil,
|
19
23
|
sps_address: nil,
|
@@ -22,7 +26,10 @@ class HumbleRPi < RPi
|
|
22
26
|
|
23
27
|
@opt = default_options.merge options
|
24
28
|
send_message 'humble_rpi initialized'
|
25
|
-
|
29
|
+
led_pins, lcd_pins = @opt[:led_pins], @opt[:lcd_pins]
|
30
|
+
|
31
|
+
@lcd = RpiLcd16x2.new 'ready', lcd_pins if lcd_pins.any?
|
32
|
+
@led = RPi.new(led_pins).led if led_pins.any?
|
26
33
|
@ws = nil
|
27
34
|
end
|
28
35
|
|
@@ -35,7 +42,8 @@ class HumbleRPi < RPi
|
|
35
42
|
|
36
43
|
protected
|
37
44
|
|
38
|
-
def
|
45
|
+
def listener(&blk)
|
46
|
+
|
39
47
|
rpi = self
|
40
48
|
|
41
49
|
c = WebSocket::EventMachine::Client
|
@@ -69,6 +77,7 @@ class HumbleRPi < RPi
|
|
69
77
|
|
70
78
|
end
|
71
79
|
|
80
|
+
alias led_listener listener
|
72
81
|
end
|
73
82
|
|
74
83
|
def motion_detect()
|
@@ -92,6 +101,7 @@ class HumbleRPi < RPi
|
|
92
101
|
|
93
102
|
end
|
94
103
|
|
104
|
+
|
95
105
|
end
|
96
106
|
|
97
107
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: humble_rpi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
K97Fz/NM76+KNaPEa6pYgH+JF/i/VxG6aln5EavRfNdLWM0pBirSt/kpw9jDToHo
|
32
32
|
YglbilVTUndGuw==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2014-
|
34
|
+
date: 2014-08-12 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rpi
|
@@ -113,6 +113,26 @@ dependencies:
|
|
113
113
|
- - ">="
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: 0.3.0
|
116
|
+
- !ruby/object:Gem::Dependency
|
117
|
+
name: rpi_lcd16x2
|
118
|
+
requirement: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - "~>"
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0.2'
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.2.0
|
126
|
+
type: :runtime
|
127
|
+
prerelease: false
|
128
|
+
version_requirements: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - "~>"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0.2'
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: 0.2.0
|
116
136
|
description:
|
117
137
|
email: james@r0bertson.co.uk
|
118
138
|
executables: []
|
@@ -132,7 +152,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
132
152
|
requirements:
|
133
153
|
- - ">="
|
134
154
|
- !ruby/object:Gem::Version
|
135
|
-
version: 2.1.
|
155
|
+
version: 2.1.0
|
136
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
157
|
requirements:
|
138
158
|
- - ">="
|
@@ -143,6 +163,7 @@ rubyforge_project:
|
|
143
163
|
rubygems_version: 2.2.2
|
144
164
|
signing_key:
|
145
165
|
specification_version: 4
|
146
|
-
summary: Designed for a Raspberry Pi which uses
|
147
|
-
with a SimplePubSub message broker
|
166
|
+
summary: 'Designed for a Raspberry Pi which uses GPIOs for the following: LEDs, a
|
167
|
+
PIR sensor, a 16x2 LCD. Communicates with a SimplePubSub message broker'
|
148
168
|
test_files: []
|
169
|
+
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|