Class: NestWrapper::State
- Inherits:
-
Object
- Object
- NestWrapper::State
- Defined in:
- lib/nest_wrapper/state.rb
Instance Attribute Summary collapse
-
#away ⇒ Object
Returns the value of attribute away.
-
#curr_temp ⇒ Object
Returns the value of attribute curr_temp.
-
#humidity ⇒ Object
Returns the value of attribute humidity.
-
#leaf ⇒ Object
Returns the value of attribute leaf.
-
#online ⇒ Object
Returns the value of attribute online.
-
#target_temp_at ⇒ Object
Returns the value of attribute target_temp_at.
-
#temp ⇒ Object
Returns the value of attribute temp.
Instance Method Summary collapse
-
#initialize(status) ⇒ State
constructor
A new instance of State.
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
#away ⇒ Object
Returns the value of attribute away.
3 4 5 |
# File 'lib/nest_wrapper/state.rb', line 3 def away @away end |
#curr_temp ⇒ Object
Returns the value of attribute curr_temp.
3 4 5 |
# File 'lib/nest_wrapper/state.rb', line 3 def curr_temp @curr_temp end |
#humidity ⇒ Object
Returns the value of attribute humidity.
3 4 5 |
# File 'lib/nest_wrapper/state.rb', line 3 def humidity @humidity end |
#leaf ⇒ Object
Returns the value of attribute leaf.
3 4 5 |
# File 'lib/nest_wrapper/state.rb', line 3 def leaf @leaf end |
#online ⇒ Object
Returns the value of attribute online.
3 4 5 |
# File 'lib/nest_wrapper/state.rb', line 3 def online @online end |
#target_temp_at ⇒ Object
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 |
#temp ⇒ Object
Returns the value of attribute temp.
3 4 5 |
# File 'lib/nest_wrapper/state.rb', line 3 def temp @temp end |