milk_maid 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/milk_maid/batch.rb +5 -1
- data/lib/milk_maid/cli.rb +2 -2
- data/lib/milk_maid/temperature_sensor.rb +1 -1
- data/lib/milk_maid/version.rb +1 -1
- 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: eeb4d3f00e56c0d1c1d808bc088b7035ba9f61cc
|
4
|
+
data.tar.gz: 19279943a4a00168f59976cd31b3aff7e7271468
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2045c759f16b7ee4d22765a611db39212a1f6c3b077c92ab9d25d22417966bb0d68c0c95bae6a0598a54441d35076c229d27e612b0447a371fe4fb61b1d5b431
|
7
|
+
data.tar.gz: de0bd9353e08ce9680b960cce24a20aad1b47e2a7ba476ae3133232f4f4c0086f1ce91f655c1300054ddeba95bd9192d1e1bfec2aeaefdda4bd4ee11bd098141
|
data/lib/milk_maid/batch.rb
CHANGED
@@ -12,7 +12,7 @@ module MilkMaid
|
|
12
12
|
|
13
13
|
def compare_temperature(current_temperature)
|
14
14
|
notifier.log_temperature(current_temperature)
|
15
|
-
current_temperature
|
15
|
+
current_temperature >= temperature
|
16
16
|
end
|
17
17
|
|
18
18
|
def start
|
@@ -38,6 +38,10 @@ module MilkMaid
|
|
38
38
|
notifier.batch_completed
|
39
39
|
end
|
40
40
|
|
41
|
+
def temperature=(value)
|
42
|
+
@temperature = value.to_f
|
43
|
+
end
|
44
|
+
|
41
45
|
private
|
42
46
|
|
43
47
|
def generate_guid
|
data/lib/milk_maid/cli.rb
CHANGED
@@ -17,7 +17,7 @@ module MilkMaid
|
|
17
17
|
option :nap, :type => :numeric, :required => false, :default => 5, :aliases => '-n'
|
18
18
|
def monitor_batch
|
19
19
|
batch_name = options.fetch(:batch_name, default_batch_name)
|
20
|
-
temperature = options[:temperature].
|
20
|
+
temperature = options[:temperature].to_f
|
21
21
|
duration = options[:duration].to_i * 60
|
22
22
|
logger_type = options[:logger]
|
23
23
|
sensor_type = options[:sensor]
|
@@ -40,7 +40,7 @@ module MilkMaid
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def get_sensor(sensor_type)
|
43
|
-
sensor_type ? ::MilkMaid::TemperatureSensor.new : ::MilkMaid::MockTemperatureSensor.new(options[:temperature].
|
43
|
+
sensor_type ? ::MilkMaid::TemperatureSensor.new : ::MilkMaid::MockTemperatureSensor.new(options[:temperature].to_f - 20, options[:temperature].to_f + 30)
|
44
44
|
end
|
45
45
|
|
46
46
|
def get_logger(logger_type)
|
data/lib/milk_maid/version.rb
CHANGED