Class: NestWrapper::State

Inherits:
Object
  • Object
show all
Defined in:
lib/nest_wrapper/state.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status) ⇒ State

Returns a new instance of State.



5
6
7
8
9
10
11
12
13
# File 'lib/nest_wrapper/state.rb', line 5

def initialize(status)
  self.online         = NestWrapper.nest.status['track'].to_a.flatten[1]['online']
  self.away           = NestWrapper.nest.away
  self.leaf           = NestWrapper.nest.leaf
  self.temp           = NestWrapper.nest.temp
  self.curr_temp      = NestWrapper.nest.current_temp
  self.humidity       = NestWrapper.nest.humidity
  self.target_temp_at = NestWrapper.nest.target_temp_at
end

Instance Attribute Details

#awayObject

Returns the value of attribute away.



3
4
5
# File 'lib/nest_wrapper/state.rb', line 3

def away
  @away
end

#curr_tempObject

Returns the value of attribute curr_temp.



3
4
5
# File 'lib/nest_wrapper/state.rb', line 3

def curr_temp
  @curr_temp
end

#humidityObject

Returns the value of attribute humidity.



3
4
5
# File 'lib/nest_wrapper/state.rb', line 3

def humidity
  @humidity
end

#leafObject

Returns the value of attribute leaf.



3
4
5
# File 'lib/nest_wrapper/state.rb', line 3

def leaf
  @leaf
end

#onlineObject

Returns the value of attribute online.



3
4
5
# File 'lib/nest_wrapper/state.rb', line 3

def online
  @online
end

#target_temp_atObject

Returns the value of attribute target_temp_at.



3
4
5
# File 'lib/nest_wrapper/state.rb', line 3

def target_temp_at
  @target_temp_at
end

#tempObject

Returns the value of attribute temp.



3
4
5
# File 'lib/nest_wrapper/state.rb', line 3

def temp
  @temp
end