brewer 0.0.40 → 0.0.42

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: 004370224c123311a290965f036fb9e4c0a85886
4
- data.tar.gz: fd7cf0def6c842ff56d9e87e0b97bc28b48ddb9b
3
+ metadata.gz: c3cb31ac65770f2293137cc4372d64a970b25019
4
+ data.tar.gz: 2db00786e0399850e5629eb8293050c01a684c2c
5
5
  SHA512:
6
- metadata.gz: 2063e62e56703756f052895ed57d2ce21876d2446a14e0222334ae58b85dc9e8cf7324c1ea25beee97dd56a8ed2bb76b0d592c8fbf302cf8aef9172fd02eaaed
7
- data.tar.gz: 313154664764ad75300cbcfe46cdf46b3ef9a560fc96452bc36d8493c51368532591390aa897b55c7abb25052ccc17cf8ebab692596032a664fe60547000746f
6
+ metadata.gz: 47164796b3a4e50e70189b1108c7bbb8fbe6af86fcb484c00167a46a79648065ed6a32a6b0ff8514c7429035efb723619d0eb5073a7ceb07ef2b6ac3282e9e71
7
+ data.tar.gz: 56aa351300d8b0d1ecefafad8fd57d157d78ad8789493b683a71e391cf796a22764cee238345600202ef7043e7e7e2426d3008caee781c5dc9a4d157ce4ce8b2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brewer (0.0.39)
4
+ brewer (0.0.40)
5
5
  git (~> 1.3, >= 1.3.0)
6
6
  net-ping (~> 1.7)
7
7
  ripl (~> 0.7.0)
data/brewer.gemspec CHANGED
@@ -2,7 +2,7 @@ require 'rake'
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "brewer"
5
- s.version = "0.0.40"
5
+ s.version = "0.0.42"
6
6
  s.default_executable = "brewer"
7
7
 
8
8
  s.authors = ["Luke Sweeney"]
data/lib/brewer.rb CHANGED
@@ -68,13 +68,21 @@ class Brewer
68
68
  self
69
69
  end
70
70
 
71
- def pid(state=0)
71
+ # Turns PID on or off, or gets state if no arg is provided
72
+ def pid(state="status")
73
+ if state == "status"
74
+ script("is_pid_running")
75
+ puts @out.first
76
+ end
77
+
72
78
  if state == 1
73
- state_string = "on"
79
+ script('set_pid_on')
80
+ puts "PID is now on"
74
81
  else
75
- state_string = "off"
82
+ script("set_pid_off")
83
+ puts "PID is now off"
76
84
  end
77
- script("set_pid_#{state_string}")
85
+
78
86
  self
79
87
  end
80
88
 
@@ -86,16 +94,30 @@ class Brewer
86
94
  end
87
95
 
88
96
  def relay_status(relay)
97
+ raise "Relay number needs to be an integer" unless relay.is_a? Integer
89
98
  script("get_relay_status", "#{relay}")
90
99
  puts @out.first
91
100
  self
92
101
  end
93
102
 
103
+ def sv(temp=nil)
104
+ if temp
105
+ raise "Temperature input needs to be an integer" unless temp.is_a? Integer
106
+ script('set_sv', temp)
107
+ puts "SV set to #{temp}"
108
+ else
109
+ script('get_sv')
110
+ puts "SV is currently " + @out.first
111
+ end
112
+ self
113
+ end
114
+
94
115
  # Procedures
95
116
 
96
117
  def boot
97
118
  # These are the states required for starting. Should be called on boot.
98
- pid(0).pump(0).relay(2, 1).all_relays_status.relay_status(2)
119
+ # Print PID status at end
120
+ pid(0).pump(0).relay(2, 1).all_relays_status
99
121
 
100
122
  @out.shift(4)
101
123
  @out.unshift("Boot successful")
data/lib/slacker.rb CHANGED
@@ -15,14 +15,15 @@ if !File.file?('.slack.yml')
15
15
  store.transaction do
16
16
  store['webhook_url'] = webhook_url
17
17
  end
18
- end
19
18
 
20
- # Here's a commnt in .slack.yml so if you find it by accident you'll know what it does
21
- File.open(".slack.yml", 'a') do |file|
22
- file.puts "# This is the slack configuration file for the brewer gem"
23
- file.puts "# You can delete this file and brewer will re-create it on start-up"
19
+ # Here's a comment in .slack.yml so if you find it by accident you'll know what it does
20
+ File.open(".slack.yml", 'a') do |file|
21
+ file.puts "# This is the slack configuration file for the brewer gem"
22
+ file.puts "# You can delete this file and brewer will re-create it on start-up"
23
+ end
24
24
  end
25
25
 
26
+
26
27
  # finally, start up a global variable for the brewer class to use
27
28
  # A full `Slacker` class is not needed, since this only does one thing
28
29
  $slack = Slack::Notifier.new YAML.load(File.open('.slack.yml'))['webhook_url']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brewer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.40
4
+ version: 0.0.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Sweeney