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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseDevice

all, from_hash_collection, #initialize, #reload

Constructor Details

This class inherits a constructor from NestConnect::Device::BaseDevice

Instance Attribute Details

#awayObject

Returns the value of attribute away.



43
44
45
# File 'lib/nest_connect/devices/structure.rb', line 43

def away
  @away
end

#co_alarm_stateObject (readonly)

Returns the value of attribute co_alarm_state.



8
9
10
# File 'lib/nest_connect/devices/structure.rb', line 8

def co_alarm_state
  @co_alarm_state
end

#country_codeObject (readonly)

Returns the value of attribute country_code.



8
9
10
# File 'lib/nest_connect/devices/structure.rb', line 8

def country_code
  @country_code
end

#eta_beginObject (readonly)

Returns the value of attribute eta_begin.



8
9
10
# File 'lib/nest_connect/devices/structure.rb', line 8

def eta_begin
  @eta_begin
end

#nameObject

Returns the value of attribute name.



54
55
56
# File 'lib/nest_connect/devices/structure.rb', line 54

def name
  @name
end

#peak_period_end_timeObject (readonly)

Returns the value of attribute peak_period_end_time.



8
9
10
# File 'lib/nest_connect/devices/structure.rb', line 8

def peak_period_end_time
  @peak_period_end_time
end

#peak_period_start_timeObject (readonly)

Returns the value of attribute peak_period_start_time.



8
9
10
# File 'lib/nest_connect/devices/structure.rb', line 8

def peak_period_start_time
  @peak_period_start_time
end

#postal_codeObject (readonly)

Returns the value of attribute postal_code.



8
9
10
# File 'lib/nest_connect/devices/structure.rb', line 8

def postal_code
  @postal_code
end

#rhr_enrollmentObject (readonly)

Returns the value of attribute rhr_enrollment.



8
9
10
# File 'lib/nest_connect/devices/structure.rb', line 8

def rhr_enrollment
  @rhr_enrollment
end

#smoke_alarm_stateObject (readonly)

Returns the value of attribute smoke_alarm_state.



8
9
10
# File 'lib/nest_connect/devices/structure.rb', line 8

def smoke_alarm_state
  @smoke_alarm_state
end

#structure_idObject (readonly)

Returns the value of attribute structure_id.



8
9
10
# File 'lib/nest_connect/devices/structure.rb', line 8

def structure_id
  @structure_id
end

#time_zoneObject (readonly)

Returns the value of attribute time_zone.



8
9
10
# File 'lib/nest_connect/devices/structure.rb', line 8

def time_zone
  @time_zone
end

#wheresObject (readonly)

Returns the value of attribute wheres.



8
9
10
# File 'lib/nest_connect/devices/structure.rb', line 8

def wheres
  @wheres
end

#wwn_security_stateObject (readonly)

Returns the value of attribute wwn_security_state.



8
9
10
# File 'lib/nest_connect/devices/structure.rb', line 8

def wwn_security_state
  @wwn_security_state
end

Class Method Details

.api_classObject



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

def self.api_class
  NestConnect::API::Devices::Structure
end

Instance Method Details

#camerasObject



35
36
37
38
39
# File 'lib/nest_connect/devices/structure.rb', line 35

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

#protectsObject



29
30
31
32
33
# File 'lib/nest_connect/devices/structure.rb', line 29

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

#thermostatsObject



23
24
25
26
27
# File 'lib/nest_connect/devices/structure.rb', line 23

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