Class: NestConnect::Device::Protect
- Inherits:
-
Object
- Object
- NestConnect::Device::Protect
- Defined in:
- lib/nest_connect/devices/protect.rb
Instance Attribute Summary collapse
-
#battery_health ⇒ Object
readonly
Returns the value of attribute battery_health.
-
#co_alarm_state ⇒ Object
readonly
Returns the value of attribute co_alarm_state.
-
#device_id ⇒ Object
readonly
Returns the value of attribute device_id.
-
#is_manual_test_active ⇒ Object
readonly
Returns the value of attribute is_manual_test_active.
-
#is_online ⇒ Object
readonly
Returns the value of attribute is_online.
-
#last_connection ⇒ Object
readonly
Returns the value of attribute last_connection.
-
#last_manual_test_time ⇒ Object
readonly
Returns the value of attribute last_manual_test_time.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#name_long ⇒ Object
readonly
Returns the value of attribute name_long.
-
#smoke_alarm_state ⇒ Object
readonly
Returns the value of attribute smoke_alarm_state.
-
#software_version ⇒ Object
readonly
Returns the value of attribute software_version.
-
#structure_id ⇒ Object
readonly
Returns the value of attribute structure_id.
-
#ui_color_state ⇒ Object
readonly
Returns the value of attribute ui_color_state.
-
#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::Protect, **args) ⇒ Protect
constructor
A new instance of Protect.
- #reload ⇒ Object
Constructor Details
#initialize(api_class: NestConnect::API::Devices::Protect, **args) ⇒ Protect
Returns a new instance of Protect.
8 9 10 11 12 13 |
# File 'lib/nest_connect/devices/protect.rb', line 8 def initialize(api_class: NestConnect::API::Devices::Protect, **args) @api_class = api_class args.each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#battery_health ⇒ Object (readonly)
Returns the value of attribute battery_health.
21 22 23 |
# File 'lib/nest_connect/devices/protect.rb', line 21 def battery_health @battery_health end |
#co_alarm_state ⇒ Object (readonly)
Returns the value of attribute co_alarm_state.
21 22 23 |
# File 'lib/nest_connect/devices/protect.rb', line 21 def co_alarm_state @co_alarm_state end |
#device_id ⇒ Object (readonly)
Returns the value of attribute device_id.
21 22 23 |
# File 'lib/nest_connect/devices/protect.rb', line 21 def device_id @device_id end |
#is_manual_test_active ⇒ Object (readonly)
Returns the value of attribute is_manual_test_active.
21 22 23 |
# File 'lib/nest_connect/devices/protect.rb', line 21 def is_manual_test_active @is_manual_test_active end |
#is_online ⇒ Object (readonly)
Returns the value of attribute is_online.
21 22 23 |
# File 'lib/nest_connect/devices/protect.rb', line 21 def is_online @is_online end |
#last_connection ⇒ Object (readonly)
Returns the value of attribute last_connection.
21 22 23 |
# File 'lib/nest_connect/devices/protect.rb', line 21 def last_connection @last_connection end |
#last_manual_test_time ⇒ Object (readonly)
Returns the value of attribute last_manual_test_time.
21 22 23 |
# File 'lib/nest_connect/devices/protect.rb', line 21 def last_manual_test_time @last_manual_test_time end |
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
21 22 23 |
# File 'lib/nest_connect/devices/protect.rb', line 21 def locale @locale end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
21 22 23 |
# File 'lib/nest_connect/devices/protect.rb', line 21 def name @name end |
#name_long ⇒ Object (readonly)
Returns the value of attribute name_long.
21 22 23 |
# File 'lib/nest_connect/devices/protect.rb', line 21 def name_long @name_long end |
#smoke_alarm_state ⇒ Object (readonly)
Returns the value of attribute smoke_alarm_state.
21 22 23 |
# File 'lib/nest_connect/devices/protect.rb', line 21 def smoke_alarm_state @smoke_alarm_state end |
#software_version ⇒ Object (readonly)
Returns the value of attribute software_version.
21 22 23 |
# File 'lib/nest_connect/devices/protect.rb', line 21 def software_version @software_version end |
#structure_id ⇒ Object (readonly)
Returns the value of attribute structure_id.
21 22 23 |
# File 'lib/nest_connect/devices/protect.rb', line 21 def structure_id @structure_id end |
#ui_color_state ⇒ Object (readonly)
Returns the value of attribute ui_color_state.
21 22 23 |
# File 'lib/nest_connect/devices/protect.rb', line 21 def ui_color_state @ui_color_state end |
#where_id ⇒ Object (readonly)
Returns the value of attribute where_id.
21 22 23 |
# File 'lib/nest_connect/devices/protect.rb', line 21 def where_id @where_id end |
#where_name ⇒ Object (readonly)
Returns the value of attribute where_name.
21 22 23 |
# File 'lib/nest_connect/devices/protect.rb', line 21 def where_name @where_name end |
Class Method Details
.from_hash_collection(hash) ⇒ Object
4 5 6 |
# File 'lib/nest_connect/devices/protect.rb', line 4 def self.from_hash_collection(hash) hash.values.map { |value| new(value) } end |
Instance Method Details
#reload ⇒ Object
15 16 17 18 19 |
# File 'lib/nest_connect/devices/protect.rb', line 15 def reload api_runner.get.body.each do |key, value| instance_variable_set("@#{key}", value) end end |