Class: NestConnect::Device::Thermostat
- Inherits:
-
Object
- Object
- NestConnect::Device::Thermostat
- Defined in:
- lib/nest_connect/devices/thermostat.rb
Constant Summary collapse
- TARGET_TEMPERATURE_F_RANGE =
(50..90)
- TARGET_TEMPERATURE_C_RANGE =
(9..30)
- FAN_TIMER_DURATION_VALUES =
[15, 30, 45, 60, 120, 240, 480, 720]
- HVAC_MODE_VALUES =
['heat', 'cool', 'heat-cool', 'eco', 'off']
- TEMPERATURE_SCALE_VALUES =
['C', 'F']
Instance Attribute Summary collapse
-
#ambient_temperature_c ⇒ Object
readonly
Returns the value of attribute ambient_temperature_c.
-
#ambient_temperature_f ⇒ Object
readonly
Returns the value of attribute ambient_temperature_f.
-
#can_cool ⇒ Object
readonly
Returns the value of attribute can_cool.
-
#can_heat ⇒ Object
readonly
Returns the value of attribute can_heat.
-
#device_id ⇒ Object
readonly
Returns the value of attribute device_id.
-
#eco_temperature_high_c ⇒ Object
readonly
Returns the value of attribute eco_temperature_high_c.
-
#eco_temperature_high_f ⇒ Object
readonly
Returns the value of attribute eco_temperature_high_f.
-
#eco_temperature_low_c ⇒ Object
readonly
Returns the value of attribute eco_temperature_low_c.
-
#eco_temperature_low_f ⇒ Object
readonly
Returns the value of attribute eco_temperature_low_f.
-
#fan_timer_active ⇒ Object
Returns the value of attribute fan_timer_active.
-
#fan_timer_duration ⇒ Object
Returns the value of attribute fan_timer_duration.
-
#fan_timer_timeout ⇒ Object
readonly
Returns the value of attribute fan_timer_timeout.
-
#has_fan ⇒ Object
readonly
Returns the value of attribute has_fan.
-
#has_leaf ⇒ Object
readonly
Returns the value of attribute has_leaf.
-
#humidity ⇒ Object
readonly
Returns the value of attribute humidity.
-
#hvac_mode ⇒ Object
Returns the value of attribute hvac_mode.
-
#hvac_state ⇒ Object
readonly
Returns the value of attribute hvac_state.
-
#is_locked ⇒ Object
readonly
Returns the value of attribute is_locked.
-
#is_online ⇒ Object
readonly
Returns the value of attribute is_online.
-
#is_using_emergency_heat ⇒ Object
readonly
Returns the value of attribute is_using_emergency_heat.
-
#label ⇒ Object
Returns the value of attribute label.
-
#last_connection ⇒ Object
readonly
Returns the value of attribute last_connection.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
-
#locked_temp_max_c ⇒ Object
readonly
Returns the value of attribute locked_temp_max_c.
-
#locked_temp_max_f ⇒ Object
readonly
Returns the value of attribute locked_temp_max_f.
-
#locked_temp_min_c ⇒ Object
readonly
Returns the value of attribute locked_temp_min_c.
-
#locked_temp_min_f ⇒ Object
readonly
Returns the value of attribute locked_temp_min_f.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#name_long ⇒ Object
readonly
Returns the value of attribute name_long.
-
#previous_hvac_mode ⇒ Object
readonly
Returns the value of attribute previous_hvac_mode.
-
#software_version ⇒ Object
readonly
Returns the value of attribute software_version.
-
#structure_id ⇒ Object
readonly
Returns the value of attribute structure_id.
-
#sunlight_correction_active ⇒ Object
readonly
Returns the value of attribute sunlight_correction_active.
-
#sunlight_correction_enabled ⇒ Object
readonly
Returns the value of attribute sunlight_correction_enabled.
-
#target_temperature_c ⇒ Object
Returns the value of attribute target_temperature_c.
-
#target_temperature_f ⇒ Object
Returns the value of attribute target_temperature_f.
-
#target_temperature_high_c ⇒ Object
Returns the value of attribute target_temperature_high_c.
-
#target_temperature_high_f ⇒ Object
Returns the value of attribute target_temperature_high_f.
-
#target_temperature_low_c ⇒ Object
Returns the value of attribute target_temperature_low_c.
-
#target_temperature_low_f ⇒ Object
Returns the value of attribute target_temperature_low_f.
-
#temperature_scale ⇒ Object
Returns the value of attribute temperature_scale.
-
#time_to_target ⇒ Object
readonly
Returns the value of attribute time_to_target.
-
#time_to_target_training ⇒ Object
readonly
Returns the value of attribute time_to_target_training.
-
#where_id ⇒ Object
readonly
Returns the value of attribute where_id.
-
#where_name ⇒ Object
readonly
Returns the value of attribute where_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(api_class: NestConnect::API::Devices::Thermostat, **args) ⇒ Thermostat
constructor
A new instance of Thermostat.
- #reload ⇒ Object
Constructor Details
#initialize(api_class: NestConnect::API::Devices::Thermostat, **args) ⇒ Thermostat
Returns a new instance of Thermostat.
11 12 13 14 15 16 |
# File 'lib/nest_connect/devices/thermostat.rb', line 11 def initialize(api_class: NestConnect::API::Devices::Thermostat, **args) @api_class = api_class args.each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#ambient_temperature_c ⇒ Object (readonly)
Returns the value of attribute ambient_temperature_c.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def ambient_temperature_c @ambient_temperature_c end |
#ambient_temperature_f ⇒ Object (readonly)
Returns the value of attribute ambient_temperature_f.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def ambient_temperature_f @ambient_temperature_f end |
#can_cool ⇒ Object (readonly)
Returns the value of attribute can_cool.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def can_cool @can_cool end |
#can_heat ⇒ Object (readonly)
Returns the value of attribute can_heat.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def can_heat @can_heat end |
#device_id ⇒ Object (readonly)
Returns the value of attribute device_id.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def device_id @device_id end |
#eco_temperature_high_c ⇒ Object (readonly)
Returns the value of attribute eco_temperature_high_c.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def eco_temperature_high_c @eco_temperature_high_c end |
#eco_temperature_high_f ⇒ Object (readonly)
Returns the value of attribute eco_temperature_high_f.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def eco_temperature_high_f @eco_temperature_high_f end |
#eco_temperature_low_c ⇒ Object (readonly)
Returns the value of attribute eco_temperature_low_c.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def eco_temperature_low_c @eco_temperature_low_c end |
#eco_temperature_low_f ⇒ Object (readonly)
Returns the value of attribute eco_temperature_low_f.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def eco_temperature_low_f @eco_temperature_low_f end |
#fan_timer_active ⇒ Object
Returns the value of attribute fan_timer_active.
54 55 56 |
# File 'lib/nest_connect/devices/thermostat.rb', line 54 def fan_timer_active @fan_timer_active end |
#fan_timer_duration ⇒ Object
Returns the value of attribute fan_timer_duration.
65 66 67 |
# File 'lib/nest_connect/devices/thermostat.rb', line 65 def fan_timer_duration @fan_timer_duration end |
#fan_timer_timeout ⇒ Object (readonly)
Returns the value of attribute fan_timer_timeout.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def fan_timer_timeout @fan_timer_timeout end |
#has_fan ⇒ Object (readonly)
Returns the value of attribute has_fan.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def has_fan @has_fan end |
#has_leaf ⇒ Object (readonly)
Returns the value of attribute has_leaf.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def has_leaf @has_leaf end |
#humidity ⇒ Object (readonly)
Returns the value of attribute humidity.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def humidity @humidity end |
#hvac_mode ⇒ Object
Returns the value of attribute hvac_mode.
78 79 80 |
# File 'lib/nest_connect/devices/thermostat.rb', line 78 def hvac_mode @hvac_mode end |
#hvac_state ⇒ Object (readonly)
Returns the value of attribute hvac_state.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def hvac_state @hvac_state end |
#is_locked ⇒ Object (readonly)
Returns the value of attribute is_locked.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def is_locked @is_locked end |
#is_online ⇒ Object (readonly)
Returns the value of attribute is_online.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def is_online @is_online end |
#is_using_emergency_heat ⇒ Object (readonly)
Returns the value of attribute is_using_emergency_heat.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def is_using_emergency_heat @is_using_emergency_heat end |
#label ⇒ Object
Returns the value of attribute label.
89 90 91 |
# File 'lib/nest_connect/devices/thermostat.rb', line 89 def label @label end |
#last_connection ⇒ Object (readonly)
Returns the value of attribute last_connection.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def last_connection @last_connection end |
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def locale @locale end |
#locked_temp_max_c ⇒ Object (readonly)
Returns the value of attribute locked_temp_max_c.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def locked_temp_max_c @locked_temp_max_c end |
#locked_temp_max_f ⇒ Object (readonly)
Returns the value of attribute locked_temp_max_f.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def locked_temp_max_f @locked_temp_max_f end |
#locked_temp_min_c ⇒ Object (readonly)
Returns the value of attribute locked_temp_min_c.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def locked_temp_min_c @locked_temp_min_c end |
#locked_temp_min_f ⇒ Object (readonly)
Returns the value of attribute locked_temp_min_f.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def locked_temp_min_f @locked_temp_min_f end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def name @name end |
#name_long ⇒ Object (readonly)
Returns the value of attribute name_long.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def name_long @name_long end |
#previous_hvac_mode ⇒ Object (readonly)
Returns the value of attribute previous_hvac_mode.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def previous_hvac_mode @previous_hvac_mode end |
#software_version ⇒ Object (readonly)
Returns the value of attribute software_version.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def software_version @software_version end |
#structure_id ⇒ Object (readonly)
Returns the value of attribute structure_id.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def structure_id @structure_id end |
#sunlight_correction_active ⇒ Object (readonly)
Returns the value of attribute sunlight_correction_active.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def sunlight_correction_active @sunlight_correction_active end |
#sunlight_correction_enabled ⇒ Object (readonly)
Returns the value of attribute sunlight_correction_enabled.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def sunlight_correction_enabled @sunlight_correction_enabled end |
#target_temperature_c ⇒ Object
Returns the value of attribute target_temperature_c.
41 42 43 |
# File 'lib/nest_connect/devices/thermostat.rb', line 41 def target_temperature_c @target_temperature_c end |
#target_temperature_f ⇒ Object
Returns the value of attribute target_temperature_f.
26 27 28 |
# File 'lib/nest_connect/devices/thermostat.rb', line 26 def target_temperature_f @target_temperature_f end |
#target_temperature_high_c ⇒ Object
Returns the value of attribute target_temperature_high_c.
98 99 100 |
# File 'lib/nest_connect/devices/thermostat.rb', line 98 def target_temperature_high_c @target_temperature_high_c end |
#target_temperature_high_f ⇒ Object
Returns the value of attribute target_temperature_high_f.
116 117 118 |
# File 'lib/nest_connect/devices/thermostat.rb', line 116 def target_temperature_high_f @target_temperature_high_f end |
#target_temperature_low_c ⇒ Object
Returns the value of attribute target_temperature_low_c.
107 108 109 |
# File 'lib/nest_connect/devices/thermostat.rb', line 107 def target_temperature_low_c @target_temperature_low_c end |
#target_temperature_low_f ⇒ Object
Returns the value of attribute target_temperature_low_f.
125 126 127 |
# File 'lib/nest_connect/devices/thermostat.rb', line 125 def target_temperature_low_f @target_temperature_low_f end |
#temperature_scale ⇒ Object
Returns the value of attribute temperature_scale.
136 137 138 |
# File 'lib/nest_connect/devices/thermostat.rb', line 136 def temperature_scale @temperature_scale end |
#time_to_target ⇒ Object (readonly)
Returns the value of attribute time_to_target.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def time_to_target @time_to_target end |
#time_to_target_training ⇒ Object (readonly)
Returns the value of attribute time_to_target_training.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def time_to_target_training @time_to_target_training end |
#where_id ⇒ Object (readonly)
Returns the value of attribute where_id.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def where_id @where_id end |
#where_name ⇒ Object (readonly)
Returns the value of attribute where_name.
147 148 149 |
# File 'lib/nest_connect/devices/thermostat.rb', line 147 def where_name @where_name end |
Class Method Details
.from_hash_collection(hash) ⇒ Object
7 8 9 |
# File 'lib/nest_connect/devices/thermostat.rb', line 7 def self.from_hash_collection(hash) hash.values.map { |value| new(value) } end |
Instance Method Details
#reload ⇒ Object
18 19 20 21 22 |
# File 'lib/nest_connect/devices/thermostat.rb', line 18 def reload api_runner.get.body.each do |key, value| instance_variable_set("@#{key}", value) end end |