Class: NestConnect::Device::Structure

Inherits:
BaseDevice
  • Object
show all
Defined in:
lib/nest_connect/devices/structure.rb

Constant Summary collapse

AWAY_VALUES =
['home', 'away']

Instance Attribute Summary collapse

Attributes inherited from BaseDevice

#access_token

Instance Method Summary collapse

Methods inherited from BaseDevice

from_hash_collection, #reload

Constructor Details

#initialize(api_class: NestConnect::API::Devices::Structure, **args) ⇒ Structure

Returns a new instance of Structure.



4
5
6
7
8
9
# File 'lib/nest_connect/devices/structure.rb', line 4

def initialize(api_class: NestConnect::API::Devices::Structure, **args)
  @api_class = api_class
  args.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
end

Instance Attribute Details

#awayObject

Returns the value of attribute away.



46
47
48
# File 'lib/nest_connect/devices/structure.rb', line 46

def away
  @away
end

#co_alarm_stateObject (readonly)

Returns the value of attribute co_alarm_state.



11
12
13
# File 'lib/nest_connect/devices/structure.rb', line 11

def co_alarm_state
  @co_alarm_state
end

#country_codeObject (readonly)

Returns the value of attribute country_code.



11
12
13
# File 'lib/nest_connect/devices/structure.rb', line 11

def country_code
  @country_code
end

#eta_beginObject (readonly)

Returns the value of attribute eta_begin.



11
12
13
# File 'lib/nest_connect/devices/structure.rb', line 11

def eta_begin
  @eta_begin
end

#nameObject

Returns the value of attribute name.



57
58
59
# File 'lib/nest_connect/devices/structure.rb', line 57

def name
  @name
end

#peak_period_end_timeObject (readonly)

Returns the value of attribute peak_period_end_time.



11
12
13
# File 'lib/nest_connect/devices/structure.rb', line 11

def peak_period_end_time
  @peak_period_end_time
end

#peak_period_start_timeObject (readonly)

Returns the value of attribute peak_period_start_time.



11
12
13
# File 'lib/nest_connect/devices/structure.rb', line 11

def peak_period_start_time
  @peak_period_start_time
end

#postal_codeObject (readonly)

Returns the value of attribute postal_code.



11
12
13
# File 'lib/nest_connect/devices/structure.rb', line 11

def postal_code
  @postal_code
end

#rhr_enrollmentObject (readonly)

Returns the value of attribute rhr_enrollment.



11
12
13
# File 'lib/nest_connect/devices/structure.rb', line 11

def rhr_enrollment
  @rhr_enrollment
end

#smoke_alarm_stateObject (readonly)

Returns the value of attribute smoke_alarm_state.



11
12
13
# File 'lib/nest_connect/devices/structure.rb', line 11

def smoke_alarm_state
  @smoke_alarm_state
end

#structure_idObject (readonly)

Returns the value of attribute structure_id.



11
12
13
# File 'lib/nest_connect/devices/structure.rb', line 11

def structure_id
  @structure_id
end

#time_zoneObject (readonly)

Returns the value of attribute time_zone.



11
12
13
# File 'lib/nest_connect/devices/structure.rb', line 11

def time_zone
  @time_zone
end

#wheresObject (readonly)

Returns the value of attribute wheres.



11
12
13
# File 'lib/nest_connect/devices/structure.rb', line 11

def wheres
  @wheres
end

#wwn_security_stateObject (readonly)

Returns the value of attribute wwn_security_state.



11
12
13
# File 'lib/nest_connect/devices/structure.rb', line 11

def wwn_security_state
  @wwn_security_state
end

Instance Method Details

#camerasObject



38
39
40
41
42
# File 'lib/nest_connect/devices/structure.rb', line 38

def cameras
  @cameras.to_a.map do |device_id|
    Device::Camera.new(device_id: device_id)
  end
end

#protectsObject



32
33
34
35
36
# File 'lib/nest_connect/devices/structure.rb', line 32

def protects
  @smoke_alarm_state.to_a.map do |device_id|
    Device::Protect.new(device_id: device_id)
  end
end

#thermostatsObject



26
27
28
29
30
# File 'lib/nest_connect/devices/structure.rb', line 26

def thermostats
  @thermostats.to_a.map do |device_id|
    Device::Thermostat.new(device_id: device_id)
  end
end