Class: EmuPower::Notifications::MessageCluster

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

Constant Summary

Constants inherited from Notification

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

#confirmation_requiredObject

Returns the value of attribute confirmation_required.



134
135
136
# File 'lib/emu_power/notifications.rb', line 134

def confirmation_required
  @confirmation_required
end

#confirmedObject

Returns the value of attribute confirmed.



135
136
137
# File 'lib/emu_power/notifications.rb', line 135

def confirmed
  @confirmed
end

#durationObject

Returns the value of attribute duration.



133
134
135
# File 'lib/emu_power/notifications.rb', line 133

def duration
  @duration
end

#idObject

Returns the value of attribute id.



129
130
131
# File 'lib/emu_power/notifications.rb', line 129

def id
  @id
end

#priorityObject

Returns the value of attribute priority.



131
132
133
# File 'lib/emu_power/notifications.rb', line 131

def priority
  @priority
end

#queueObject

Returns the value of attribute queue.



136
137
138
# File 'lib/emu_power/notifications.rb', line 136

def queue
  @queue
end

#start_timeObject

Returns the value of attribute start_time.



132
133
134
# File 'lib/emu_power/notifications.rb', line 132

def start_time
  @start_time
end

#textObject

Returns the value of attribute text.



130
131
132
# File 'lib/emu_power/notifications.rb', line 130

def text
  @text
end

Instance Method Details

#build(hash) ⇒ Object



138
139
140
141
142
143
144
145
146
147
# File 'lib/emu_power/notifications.rb', line 138

def build(hash)
	self.id = hash['Id']
	self.text = hash['Text']
	self.priority = hash['Priority']
	self.start_time = parse_timestamp('StartTime')
	self.duration = parse_hex('Duration')
	self.confirmation_required = parse_bool('ConfirmationRequired')
	self.confirmed = parse_bool('Confirmed')
	self.queue = hash['Queue']
end