Class: Aurora::Thermostat

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

Direct Known Subclasses

IZ2Zone

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Component

#initialize, #inspect

Constructor Details

This class inherits a constructor from Aurora::Component

Instance Attribute Details

#ambient_temperatureObject (readonly)

Returns the value of attribute ambient_temperature.



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

def ambient_temperature
  @ambient_temperature
end

#cooling_target_temperatureObject

Returns the value of attribute cooling_target_temperature.



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

def cooling_target_temperature
  @cooling_target_temperature
end

#current_fan_modeObject (readonly)

Returns the value of attribute current_fan_mode.



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

def current_fan_mode
  @current_fan_mode
end

#current_modeObject (readonly)

Returns the value of attribute current_mode.



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

def current_mode
  @current_mode
end

#fan_intermittent_offObject

Returns the value of attribute fan_intermittent_off.



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

def fan_intermittent_off
  @fan_intermittent_off
end

#fan_intermittent_onObject

Returns the value of attribute fan_intermittent_on.



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

def fan_intermittent_on
  @fan_intermittent_on
end

#heating_target_temperatureObject

Returns the value of attribute heating_target_temperature.



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

def heating_target_temperature
  @heating_target_temperature
end

#target_fan_modeObject

Returns the value of attribute target_fan_mode.



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

def target_fan_mode
  @target_fan_mode
end

#target_modeObject

Returns the value of attribute target_mode.



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

def target_mode
  @target_mode
end

Instance Method Details

#refresh(registers) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/aurora/thermostat.rb', line 23

def refresh(registers)
  if @abc.awl_thermostat?
    @ambient_temperature = registers[502]
    @heating_target_temperature = registers[745]
    @cooling_target_temperature = registers[746]
    config1 = registers[12_005]
    config2 = registers[12_006]
    @target_fan_mode = config1[:fan]
    @fan_intermittent_on = config1[:on_time]
    @fan_intermittent_off = config1[:off_time]
    @target_mode = config2[:mode]
  end

  inputs = registers[31]
  @current_fan_mode = inputs.include?(:g)
  @current_mode = if inputs[:y2]
                    inputs[:o] ? :c2 : :h2
                  elsif inputs[:y1]
                    inputs[:o] ? :c1 : :h1
                  else
                    :standby
                  end
end

#registers_to_readObject



17
18
19
20
21
# File 'lib/aurora/thermostat.rb', line 17

def registers_to_read
  return [] unless @abc.awl_thermostat?

  [502, 745..746, 12_005..12_006]
end