Class: Aurora::Blower::FiveSpeed
- Defined in:
- lib/aurora/blower.rb
Instance Attribute Summary collapse
-
#speed ⇒ Object
readonly
Returns the value of attribute speed.
Attributes inherited from PSC
Instance Method Summary collapse
Methods inherited from PSC
#initialize, #registers_to_read
Methods inherited from Component
#initialize, #inspect, #registers_to_read
Constructor Details
This class inherits a constructor from Aurora::Blower::PSC
Instance Attribute Details
#speed ⇒ Object (readonly)
Returns the value of attribute speed.
31 32 33 |
# File 'lib/aurora/blower.rb', line 31 def speed @speed end |
Instance Method Details
#refresh(registers) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/aurora/blower.rb', line 37 def refresh(registers) outputs = registers[30] @speed = if outputs.include?(:eh1) || outputs.include?(:eh2) 4 elsif outputs.include?(:cc2) 3 elsif outputs.include?(:cc) 2 elsif outputs.include?(:blower) 1 else 0 end end |
#speed_range ⇒ Object
33 34 35 |
# File 'lib/aurora/blower.rb', line 33 def speed_range 0..4 end |