Class: EmuPower::Notifications::NetworkInfo

Inherits:
Notification show all
Defined in:
lib/emu_power/notifications.rb

Constant Summary

Constants inherited from Notification

EmuPower::Notifications::Notification::UNIX_TIME_OFFSET

Instance Attribute Summary collapse

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

#channelObject

Returns the value of attribute channel.



157
158
159
# File 'lib/emu_power/notifications.rb', line 157

def channel
  @channel
end

#coordinator_macObject

Returns the value of attribute coordinator_mac.



153
154
155
# File 'lib/emu_power/notifications.rb', line 153

def coordinator_mac
  @coordinator_mac
end

#descriptionObject

Returns the value of attribute description.



155
156
157
# File 'lib/emu_power/notifications.rb', line 155

def description
  @description
end

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_idObject

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_addressObject

Returns the value of attribute short_address.



158
159
160
# File 'lib/emu_power/notifications.rb', line 158

def short_address
  @short_address
end

#statusObject

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