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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b45e70eb0370ee7850e58e83a61752f20f7a960
4
- data.tar.gz: 4b25bcc182eee39aea18b1b1a60edf950da5c448
3
+ metadata.gz: eeb4d3f00e56c0d1c1d808bc088b7035ba9f61cc
4
+ data.tar.gz: 19279943a4a00168f59976cd31b3aff7e7271468
5
5
  SHA512:
6
- metadata.gz: 5b8fc7c39eb5d1561dab24f6626d3f86916bf74ca2961b18834d6303c091632412868f150559685b37f2239c319c1c2a00f52f68e0474e59f8f8d2f912336ef8
7
- data.tar.gz: e860a9a2ad60ad402040a9459884d7650f96f198324b99b1de2824cd4c62af801268319c5fe87e4cf99dcc4b82c705cb7b566b1f73c0c586533ebd3e9719f0c8
6
+ metadata.gz: 2045c759f16b7ee4d22765a611db39212a1f6c3b077c92ab9d25d22417966bb0d68c0c95bae6a0598a54441d35076c229d27e612b0447a371fe4fb61b1d5b431
7
+ data.tar.gz: de0bd9353e08ce9680b960cce24a20aad1b47e2a7ba476ae3133232f4f4c0086f1ce91f655c1300054ddeba95bd9192d1e1bfec2aeaefdda4bd4ee11bd098141
@@ -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.to_i >= temperature.to_i
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].to_i
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].to_i - 20, options[:temperature].to_i + 30)
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)
@@ -17,7 +17,7 @@ module MilkMaid
17
17
 
18
18
  def reading
19
19
  return "Reading: No sensor attached" unless @sensor.reading
20
- @sensor.reading
20
+ @sensor.reading.to_f
21
21
  end
22
22
  end
23
23
 
@@ -1,3 +1,3 @@
1
1
  module MilkMaid
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: milk_maid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Newell