brewer 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/lib/brewer/controller.rb +23 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 749168c8c1db7fa0905bea649bfeab99495b1d14
|
4
|
+
data.tar.gz: 1452e8a6bf8c7a987ecbf14179776263e6f67fb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 375199b1d4311bc70682718f7dc76bbd587511dc38e6f5b3346ec1692780f3c7ec8d582d1c64c13b31c96f67e89a9c15ac049dddef937d29d2311150967dbb87
|
7
|
+
data.tar.gz: a66ef784129bb556be4e958d6c4648d37f6a4ab3c6503861261998dc9793c85076b9e0df28e5e96e0ee0c44fcbd6aba118a48ca290728c8073ae00fd8e79acf4
|
data/Gemfile.lock
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
brewer (0.
|
4
|
+
brewer (0.1.1)
|
5
5
|
brewer-adaptibrew
|
6
6
|
git (~> 1.3, >= 1.3.0)
|
7
7
|
net-ping (~> 1.7)
|
8
8
|
pry
|
9
9
|
rainbow
|
10
10
|
require_all
|
11
|
-
slack-notifier
|
11
|
+
slack-notifier
|
12
12
|
terminal-table
|
13
13
|
wannabe_bool
|
14
14
|
|
15
15
|
GEM
|
16
16
|
remote: https://rubygems.org/
|
17
17
|
specs:
|
18
|
-
brewer-adaptibrew (0.1.
|
18
|
+
brewer-adaptibrew (0.1.3)
|
19
19
|
git (~> 1.3, >= 1.3.0)
|
20
20
|
coderay (1.1.1)
|
21
21
|
diff-lcs (1.3)
|
@@ -51,7 +51,7 @@ GEM
|
|
51
51
|
json (>= 1.8, < 3)
|
52
52
|
simplecov-html (~> 0.10.0)
|
53
53
|
simplecov-html (0.10.1)
|
54
|
-
slack-notifier (2.1
|
54
|
+
slack-notifier (2.2.1)
|
55
55
|
slop (3.6.0)
|
56
56
|
terminal-table (1.8.0)
|
57
57
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
data/lib/brewer/controller.rb
CHANGED
@@ -56,6 +56,16 @@ module Brewer
|
|
56
56
|
return script("set_pid_off")
|
57
57
|
end
|
58
58
|
end
|
59
|
+
|
60
|
+
# This is for jake's js
|
61
|
+
def pid_to_web
|
62
|
+
return {
|
63
|
+
'pid_running' => script('is_pid_running').to_b,
|
64
|
+
'sv' => sv,
|
65
|
+
'pv' => pv
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
59
69
|
|
60
70
|
# Sets the setpoint value (sv) on the PID, or returns the current SV
|
61
71
|
def sv(temp=nil)
|
@@ -125,6 +135,8 @@ module Brewer
|
|
125
135
|
return "off"
|
126
136
|
end
|
127
137
|
end
|
138
|
+
|
139
|
+
|
128
140
|
|
129
141
|
# Returns the status of all relays
|
130
142
|
def all_relays_status
|
@@ -145,6 +157,17 @@ module Brewer
|
|
145
157
|
statuses
|
146
158
|
end
|
147
159
|
|
160
|
+
def relays_status_to_web
|
161
|
+
statuses = relays_status
|
162
|
+
return statuses.each { |_, v|
|
163
|
+
if v == "on"
|
164
|
+
v = 1
|
165
|
+
else
|
166
|
+
v = 0
|
167
|
+
end
|
168
|
+
}
|
169
|
+
end
|
170
|
+
|
148
171
|
# Give this a relay configuration hash and it will set the relays to that configuration
|
149
172
|
# eg. {'hlt' => 0, 'rims_to' => 'boil', 'pump' => 1}
|
150
173
|
# This is so that we can set multiple valves at effectively the same time
|