Class: Redlink::Ui

Inherits:
Redthing show all
Defined in:
lib/redlink/ui.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Redthing

#initialize

Constructor Details

This class inherits a constructor from Redlink::Redthing

Instance Attribute Details

#can_set_switch_autoObject

Returns the value of attribute can_set_switch_auto.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def can_set_switch_auto
  @can_set_switch_auto
end

#can_set_switch_coolObject

Returns the value of attribute can_set_switch_cool.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def can_set_switch_cool
  @can_set_switch_cool
end

#can_set_switch_emergency_heatObject

Returns the value of attribute can_set_switch_emergency_heat.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def can_set_switch_emergency_heat
  @can_set_switch_emergency_heat
end

#can_set_switch_heatObject

Returns the value of attribute can_set_switch_heat.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def can_set_switch_heat
  @can_set_switch_heat
end

#can_set_switch_offObject

Returns the value of attribute can_set_switch_off.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def can_set_switch_off
  @can_set_switch_off
end

#can_set_switch_southern_awayObject

Returns the value of attribute can_set_switch_southern_away.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def can_set_switch_southern_away
  @can_set_switch_southern_away
end

#commercialObject

Returns the value of attribute commercial.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def commercial
  @commercial
end

#cool_lower_setpt_limitObject

Returns the value of attribute cool_lower_setpt_limit.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def cool_lower_setpt_limit
  @cool_lower_setpt_limit
end

#cool_next_periodObject

Returns the value of attribute cool_next_period.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def cool_next_period
  @cool_next_period
end

#cool_setpointObject

Returns the value of attribute cool_setpoint.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def cool_setpoint
  @cool_setpoint
end

#cool_upper_setpt_limitObject

Returns the value of attribute cool_upper_setpt_limit.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def cool_upper_setpt_limit
  @cool_upper_setpt_limit
end

#createdObject

Returns the value of attribute created.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def created
  @created
end

#deadbandObject

Returns the value of attribute deadband.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def deadband
  @deadband
end

#disp_temperatureObject

Returns the value of attribute disp_temperature.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def disp_temperature
  @disp_temperature
end

#displayed_unitsObject

Returns the value of attribute displayed_units.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def displayed_units
  @displayed_units
end

#dual_setpoint_statusObject

Returns the value of attribute dual_setpoint_status.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def dual_setpoint_status
  @dual_setpoint_status
end

#heat_lower_setpt_limitObject

Returns the value of attribute heat_lower_setpt_limit.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def heat_lower_setpt_limit
  @heat_lower_setpt_limit
end

#heat_next_periodObject

Returns the value of attribute heat_next_period.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def heat_next_period
  @heat_next_period
end

#heat_setpointObject

Returns the value of attribute heat_setpoint.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def heat_setpoint
  @heat_setpoint
end

#heat_upper_setpt_limitObject

Returns the value of attribute heat_upper_setpt_limit.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def heat_upper_setpt_limit
  @heat_upper_setpt_limit
end

#hold_until_capableObject

Returns the value of attribute hold_until_capable.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def hold_until_capable
  @hold_until_capable
end

#indoor_humidityObject

Returns the value of attribute indoor_humidity.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def indoor_humidity
  @indoor_humidity
end

#outdoor_humidityObject

Returns the value of attribute outdoor_humidity.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def outdoor_humidity
  @outdoor_humidity
end

#outdoor_tempObject

Returns the value of attribute outdoor_temp.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def outdoor_temp
  @outdoor_temp
end

#sched_cool_spObject

Returns the value of attribute sched_cool_sp.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def sched_cool_sp
  @sched_cool_sp
end

#sched_heat_spObject

Returns the value of attribute sched_heat_sp.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def sched_heat_sp
  @sched_heat_sp
end

#schedule_capableObject

Returns the value of attribute schedule_capable.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def schedule_capable
  @schedule_capable
end

#status_coolObject

Returns the value of attribute status_cool.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def status_cool
  @status_cool
end

#status_heatObject

Returns the value of attribute status_heat.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def status_heat
  @status_heat
end

#system_switch_positionObject

Returns the value of attribute system_switch_position.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def system_switch_position
  @system_switch_position
end

#thermostat_lockedObject

Returns the value of attribute thermostat_locked.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def thermostat_locked
  @thermostat_locked
end

#vacation_holdObject

Returns the value of attribute vacation_hold.



5
6
7
# File 'lib/redlink/ui.rb', line 5

def vacation_hold
  @vacation_hold
end

Instance Method Details

#cooling?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/redlink/ui.rb', line 46

def cooling?
  status_cool.to_i == 1
end

#heating?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/redlink/ui.rb', line 42

def heating?
  status_heat.to_i == 1
end

#overridden?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/redlink/ui.rb', line 50

def overridden?
  heat_setpoint != sched_heat_sp && cool_setpoint != sched_cool_sp
end

#statusObject



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/redlink/ui.rb', line 54

def status
  if heating?
    if overridden?
      return '(heating via override)'
    else
      return '(heating)'
    end
  elsif cooling?
    if overridden?
      return '(cooling via override)'
    else
      return '(cooling)'
    end
  end
end

#to_sObject



70
71
72
# File 'lib/redlink/ui.rb', line 70

def to_s
  "#{disp_temperature.to_i}° / #{heat_setpoint}° #{status}"
end