Module: Mochizuki::Status::ClassMethods
- Defined in:
- lib/mochizuki/status.rb
Instance Method Summary collapse
Instance Method Details
#reset_status ⇒ Object
14 15 16 |
# File 'lib/mochizuki/status.rb', line 14 def reset_status @status = Status.new end |
#status ⇒ Object
10 11 12 |
# File 'lib/mochizuki/status.rb', line 10 def status @status ||= Status.new end |
#update_status(power) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/mochizuki/status.rb', line 18 def update_status(power) last = Mochizuki.status.below_threshold current = power.to_f < @config.alarm_threshold.to_f @logger.info "Update status, @below_threshold, last: #{last}, current: #{current}" Mochizuki.status.below_threshold = current return unless !current && last # re-enabled auto alarm Mochizuki.status.alarmed_before = false @logger.info 'Auto alarm enabled' end |