Sha256: b9c0bb3f7aede5f9a8150aaf05f1013e10a0649cf19b8fb3041f7488afa4c845

Contents?: true

Size: 706 Bytes

Versions: 2

Compression:

Stored size: 706 Bytes

Contents

$: << File.join(File.dirname(__FILE__), '..', 'lib')
require 'brewby'

class StepMash < Brewby::Application
  def tick
    super
    render_status
  end

  def render_status
    @last_output ||= Time.now
    if @last_output < (Time.now - 1)
      puts "Target: #{current_step.target}F\tActual: #{current_step.last_reading}F\tPower Level: #{current_step.power_level * 100}%"
      @last_output = Time.now
    end
  end
end

application = StepMash.new adapter: 'test', inputs: [{}], outputs: [{}]
application.add_step :temp_control, target: 125.0, duration: 15
application.add_step :temp_control, target: 155.0, duration: 35
application.add_step :temp_control, target: 168.0, duration: 10

application.start

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
brewby-0.1.1 examples/basic_control.rb
brewby-0.1.0 examples/basic_control.rb