Class: EmuPower::Notifications::NetworkInfo
- Inherits:
-
Notification
- Object
- Notification
- EmuPower::Notifications::NetworkInfo
- Defined in:
- lib/emu_power/notifications.rb
Constant Summary
Constants inherited from Notification
EmuPower::Notifications::Notification::UNIX_TIME_OFFSET
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#coordinator_mac ⇒ Object
Returns the value of attribute coordinator_mac.
-
#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.
157 158 159 |
# File 'lib/emu_power/notifications.rb', line 157 def channel @channel end |
#coordinator_mac ⇒ Object
Returns the value of attribute coordinator_mac.
153 154 155 |
# File 'lib/emu_power/notifications.rb', line 153 def coordinator_mac @coordinator_mac end |
#description ⇒ Object
Returns the value of attribute description.
155 156 157 |
# File 'lib/emu_power/notifications.rb', line 155 def description @description end |
#link_strength ⇒ Object
Returns the value of attribute link_strength.
159 160 161 |
# File 'lib/emu_power/notifications.rb', line 159 def link_strength @link_strength end |
#pan_id ⇒ Object
Returns the value of attribute pan_id.
156 157 158 |
# File 'lib/emu_power/notifications.rb', line 156 def pan_id @pan_id end |
#short_address ⇒ Object
Returns the value of attribute short_address.
158 159 160 |
# File 'lib/emu_power/notifications.rb', line 158 def short_address @short_address end |
#status ⇒ Object
Returns the value of attribute status.
154 155 156 |
# File 'lib/emu_power/notifications.rb', line 154 def status @status end |
Instance Method Details
#build(hash) ⇒ Object
161 162 163 164 165 166 167 168 169 |
# File 'lib/emu_power/notifications.rb', line 161 def build(hash) self.coordinator_mac = parse_hex('CoordMacId') 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 |