the_energy_detective 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ted/ecc.rb +22 -0
  3. data/lib/ted/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e31b8b26c7325bd9c3b17378d9130c5dd3dd1ea3
4
- data.tar.gz: d404cc3275af98ff26f9a98d5e3ffcb604db5ff0
3
+ metadata.gz: 3abae2ac25a1c3d65ecddbb4646cac6c9c0a5f78
4
+ data.tar.gz: 58e4de4ca9b32697870a5a3b490c90b449fe0d09
5
5
  SHA512:
6
- metadata.gz: c049d7fa482332b2493d524af2565d8b59bc771005cff7f690515a19f3966bb08926f28480ea0de7fcf104c8b493da74973b375d2a098df5f80413e24380cb99
7
- data.tar.gz: 68a10989eca53e8976ab3669f43085216033617c9faee8621fef2359a9795f6fcb70a1c660e84fa50ba8b013e8ba8ef00f8340aa50d5856fc950672b5bf30dd4
6
+ metadata.gz: c28b5a221971ba2610476d287c399a0da840e43d0d757d0385515051242a04a74774782699d1bd71ea2bdc7ac8dd95bb05f1608c977f84886efab66c0903d622
7
+ data.tar.gz: a49069c564006d35c94f8bb00fa150adb777836384d702fb0af05fd7763ecfbb8c68ba60975a27d26a4b0689da7de36bd8c656020e1024744e674261a70637c3
data/lib/ted/ecc.rb CHANGED
@@ -53,6 +53,28 @@ module TED
53
53
  dashboard_data(Nokogiri::XML(query("api/DashData.xml", params)))
54
54
  end
55
55
 
56
+ def system_overview
57
+ xml = Nokogiri::XML(query("api/SystemOverview.xml", T: 0))
58
+ result = ObjectHash.new
59
+ (1..4).each do |i|
60
+ mtu = {}
61
+ mtu_xml = xml.at_css("MTU#{i}")
62
+ mtu[:power] = mtu_xml.at_css("Value").text.to_i
63
+ mtu[:apparent_power] = mtu_xml.at_css("KVA").text.to_i
64
+ mtu[:power_factor] = mtu_xml.at_css("PF").text.to_i / 100.0
65
+ voltage_xml = mtu_xml.at_css("PhaseVoltage")
66
+ current_xml = mtu_xml.at_css("PhaseCurrent")
67
+ mtu[:voltage] = {}
68
+ mtu[:current] = {}
69
+ %w{A B C}.each do |phase|
70
+ mtu[:voltage][phase.to_sym] = voltage_xml.at_css(phase).text.to_i / 10.0
71
+ mtu[:current][phase.to_sym] = current_xml.at_css(phase).text.to_i / 10.0
72
+ end
73
+ result[i - 1] = result[mtus[i - 1].description] = mtu
74
+ end
75
+ result
76
+ end
77
+
56
78
  # A hash of the MTUs[rdoc-ref:MTU] connected to this ECC.
57
79
  # It is indexed by both description and numerical index
58
80
  def mtus
data/lib/ted/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module TED
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: the_energy_detective
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-15 00:00:00.000000000 Z
11
+ date: 2016-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri