Class: EmuPower::Notifications::CurrentPeriodUsage
- Inherits:
-
Notification
- Object
- Notification
- EmuPower::Notifications::CurrentPeriodUsage
- Defined in:
- lib/emu_power/notifications.rb
Constant Summary
Constants inherited from Notification
Notification::UNIX_TIME_OFFSET
Instance Attribute Summary collapse
-
#digits_left ⇒ Object
Returns the value of attribute digits_left.
-
#digits_right ⇒ Object
Returns the value of attribute digits_right.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#suppress_leading_zeroes ⇒ Object
Returns the value of attribute suppress_leading_zeroes.
-
#usage ⇒ Object
Returns the value of attribute usage.
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
#digits_left ⇒ Object
Returns the value of attribute digits_left.
257 258 259 |
# File 'lib/emu_power/notifications.rb', line 257 def digits_left @digits_left end |
#digits_right ⇒ Object
Returns the value of attribute digits_right.
256 257 258 |
# File 'lib/emu_power/notifications.rb', line 256 def digits_right @digits_right end |
#start_date ⇒ Object
Returns the value of attribute start_date.
259 260 261 |
# File 'lib/emu_power/notifications.rb', line 259 def start_date @start_date end |
#suppress_leading_zeroes ⇒ Object
Returns the value of attribute suppress_leading_zeroes.
258 259 260 |
# File 'lib/emu_power/notifications.rb', line 258 def suppress_leading_zeroes @suppress_leading_zeroes end |
#usage ⇒ Object
Returns the value of attribute usage.
255 256 257 |
# File 'lib/emu_power/notifications.rb', line 255 def usage @usage end |
Instance Method Details
#build(hash) ⇒ Object
261 262 263 264 265 266 267 268 |
# File 'lib/emu_power/notifications.rb', line 261 def build(hash) self.usage = parse_amount('CurrentUsage') self.digits_right = parse_hex('DigitsRight') self.digits_left = parse_hex('DigitsLeft') self.suppress_leading_zeroes = parse_bool('SuppressLeadingZero') self.start_date = ('StartDate') end |