Class: Aurora::Pump::GenericPump

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

Direct Known Subclasses

VSPump

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Component

#inspect

Constructor Details

#initialize(abc, type) ⇒ GenericPump

Returns a new instance of GenericPump.



11
12
13
14
# File 'lib/aurora/pump.rb', line 11

def initialize(abc, type)
  super(abc)
  @type = type
end

Instance Attribute Details

#runningObject (readonly) Also known as: running?

Returns the value of attribute running.



8
9
10
# File 'lib/aurora/pump.rb', line 8

def running
  @running
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/aurora/pump.rb', line 8

def type
  @type
end

#waterflowObject (readonly)

Returns the value of attribute waterflow.



8
9
10
# File 'lib/aurora/pump.rb', line 8

def waterflow
  @waterflow
end

#wattsObject (readonly)

Returns the value of attribute watts.



8
9
10
# File 'lib/aurora/pump.rb', line 8

def watts
  @watts
end

Instance Method Details

#refresh(registers) ⇒ Object



22
23
24
25
26
# File 'lib/aurora/pump.rb', line 22

def refresh(registers)
  @waterflow = registers[1117]
  @watts = registers[1164] if abc.energy_monitoring?
  @running = registers[1104].include?(:loop_pump)
end

#registers_to_readObject



16
17
18
19
20
# File 'lib/aurora/pump.rb', line 16

def registers_to_read
  result = [1117]
  result.push(1164..1165) if abc.energy_monitoring?
  result
end