Class: EmuPower::Notifications::ConnectionStatus
- Inherits:
-
Notification
- Object
- Notification
- EmuPower::Notifications::ConnectionStatus
- Defined in:
- lib/emu_power/notifications.rb
Constant Summary
Constants inherited from Notification
Notification::UNIX_TIME_OFFSET
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#description ⇒ Object
Returns the value of attribute description.
-
#link_strength ⇒ Object
Returns the value of attribute link_strength.
-
#pan_id ⇒ Object
Returns the value of attribute pan_id.
-
#short_address ⇒ Object
Returns the value of attribute short_address.
-
#status ⇒ Object
Returns the value of attribute status.
Attributes inherited from Notification
#device_mac, #meter_mac, #raw, #timestamp
Instance Method Summary collapse
Methods inherited from Notification
#initialize, #parse_amount, #parse_bool, #parse_hex, #parse_timestamp, root_name, subclasses, #to_s
Constructor Details
This class inherits a constructor from EmuPower::Notifications::Notification
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
178 179 180 |
# File 'lib/emu_power/notifications.rb', line 178 def channel @channel end |
#description ⇒ Object
Returns the value of attribute description.
176 177 178 |
# File 'lib/emu_power/notifications.rb', line 176 def description @description end |
#link_strength ⇒ Object
Returns the value of attribute link_strength.
180 181 182 |
# File 'lib/emu_power/notifications.rb', line 180 def link_strength @link_strength end |
#pan_id ⇒ Object
Returns the value of attribute pan_id.
177 178 179 |
# File 'lib/emu_power/notifications.rb', line 177 def pan_id @pan_id end |
#short_address ⇒ Object
Returns the value of attribute short_address.
179 180 181 |
# File 'lib/emu_power/notifications.rb', line 179 def short_address @short_address end |
#status ⇒ Object
Returns the value of attribute status.
175 176 177 |
# File 'lib/emu_power/notifications.rb', line 175 def status @status end |
Instance Method Details
#build(hash) ⇒ Object
182 183 184 185 186 187 188 189 |
# File 'lib/emu_power/notifications.rb', line 182 def build(hash) self.status = hash['Status'] self.description = hash['Description'] self.pan_id = hash['ExtPanId'] self.channel = hash['Channel'] self.short_address = hash['ShortAddr'] self.link_strength = parse_hex('LinkStrength') end |