Class: Aurora::AuxHeat

Inherits:
Component show all
Defined in:
lib/aurora/aux_heat.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Component

#initialize, #inspect, #registers_to_read

Constructor Details

This class inherits a constructor from Aurora::Component

Instance Attribute Details

#stageObject (readonly)

Returns the value of attribute stage.



7
8
9
# File 'lib/aurora/aux_heat.rb', line 7

def stage
  @stage
end

#wattsObject (readonly)

Returns the value of attribute watts.



7
8
9
# File 'lib/aurora/aux_heat.rb', line 7

def watts
  @watts
end

Instance Method Details

#refresh(registers) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/aurora/aux_heat.rb', line 9

def refresh(registers)
  outputs = registers[30]
  @stage = if outputs.include?(:eh2)
             2
           elsif outputs.include?(:eh1)
             1
           else
             0
           end
  @watts = registers[1151] if abc.energy_monitoring?
end