Class: CurrentCostDaemon::Publishers::Debug
- Inherits:
-
Object
- Object
- CurrentCostDaemon::Publishers::Debug
- Defined in:
- lib/currentcostd/publishers/debug.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config) ⇒ Debug
constructor
A new instance of Debug.
- #update(reading) ⇒ Object
Constructor Details
#initialize(config) ⇒ Debug
Returns a new instance of Debug.
33 34 |
# File 'lib/currentcostd/publishers/debug.rb', line 33 def initialize(config) end |
Class Method Details
.config_section ⇒ Object
29 30 31 |
# File 'lib/currentcostd/publishers/debug.rb', line 29 def self.config_section 'debug' end |
Instance Method Details
#update(reading) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/currentcostd/publishers/debug.rb', line 36 def update(reading) # Print out measurement if reading.total_watts > 0 puts "New reading received: #{reading.total_watts} W" else puts "0 reading received: probably history data" end rescue puts "Something went wrong (debug)!" puts $!.inspect end |