Floppy-currentcost 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/currentcost/reading.rb +9 -0
- metadata +2 -2
data/lib/currentcost/reading.rb
CHANGED
@@ -76,6 +76,15 @@ module CurrentCost
|
|
76
76
|
# Historical data, represented as a hash. There is a hash entry for days, weeks, months, and years. Each of these is an array of historical kWh data.
|
77
77
|
attr_accessor :history
|
78
78
|
|
79
|
+
# The sum of the current wattage for all channels, as shown on the meter
|
80
|
+
def total_watts
|
81
|
+
watts = 0
|
82
|
+
channels.each { |c| watts += c[:watts] }
|
83
|
+
return watts
|
84
|
+
rescue
|
85
|
+
0
|
86
|
+
end
|
87
|
+
|
79
88
|
end
|
80
89
|
|
81
90
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Floppy-currentcost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Smith
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-08-
|
12
|
+
date: 2008-08-28 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|