saj_collector 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -1
- data/exe/saj_collector +8 -3
- data/exe/saj_output_collector +5 -0
- data/lib/saj_collector/version.rb +1 -1
- data/saj_collector.gemspec +1 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 370630fb07fea199502ce6a8a421ce7d0e4a8253fec109baac95597ed8d0e225
|
4
|
+
data.tar.gz: 319651b7846f4ece02d5d8d725873291cf490d3a20e3dbfbb9e6775f622f9ea7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c27ed515b65a42606a847f52edd54e35df6d794f53d999e3f24219599bc766b6932e2f226a4efc6db1c0b4c8f2891e2f68b04952bd33305937ea2e00d7eb7a6
|
7
|
+
data.tar.gz: 814743887fe0821186275a9ac7bc6a15650db9d4dddeb5166c1c7acccbe3f06e3e4a8bb32a47b0d90b0f8d8680b6fda5e52ff7bdacb4c9badde1912ff20c7a33
|
data/README.md
CHANGED
data/exe/saj_collector
CHANGED
@@ -4,6 +4,7 @@ require 'rexml/document'
|
|
4
4
|
require 'net/http'
|
5
5
|
require 'pvoutput/client'
|
6
6
|
require 'yaml'
|
7
|
+
require 'ipaddress'
|
7
8
|
|
8
9
|
# Load the configuration from the yaml file
|
9
10
|
sajcollector_config = YAML.load_file('saj_collector.yaml')
|
@@ -12,6 +13,13 @@ sajcollector_config = YAML.load_file('saj_collector.yaml')
|
|
12
13
|
# can be obtained from the pvoutput website
|
13
14
|
pvoutput = PVOutput::Client.new(sajcollector_config[:system_id], sajcollector_config[:api_key])
|
14
15
|
|
16
|
+
unless IPAddress.valid?(sajcollector_config[:saj])
|
17
|
+
raise ("[#{sajcollector_config[:saj]}] is not a valid IP address")
|
18
|
+
end
|
19
|
+
|
20
|
+
# Get the current realtime data from the SAJ device
|
21
|
+
c = Net::HTTP.get(sajcollector_config[:saj], '/real_time_data.xml')
|
22
|
+
|
15
23
|
options = {
|
16
24
|
'temperature' => 0, # Temperature in celcius
|
17
25
|
'energy_generated' => 0, # Energy generation in watt hours
|
@@ -24,9 +32,6 @@ options = {
|
|
24
32
|
'runtime_all_time' => 0
|
25
33
|
}
|
26
34
|
|
27
|
-
# Get the current realtime data from the SAJ device
|
28
|
-
c = Net::HTTP.get(sajcollector_config[:saj], '/real_time_data.xml')
|
29
|
-
|
30
35
|
# Let REXML parse the XML site
|
31
36
|
doc = REXML::Document.new c
|
32
37
|
|
data/exe/saj_output_collector
CHANGED
@@ -4,6 +4,7 @@ require 'rexml/document'
|
|
4
4
|
require 'net/http'
|
5
5
|
require 'pvoutput/client'
|
6
6
|
require 'yaml'
|
7
|
+
require 'ipaddress'
|
7
8
|
|
8
9
|
# Load the configuration from the yaml file
|
9
10
|
sajcollector_config = YAML.load_file('saj_collector.yaml')
|
@@ -12,6 +13,10 @@ sajcollector_config = YAML.load_file('saj_collector.yaml')
|
|
12
13
|
# can be obtained from the pvoutput website
|
13
14
|
pvoutput = PVOutput::Client.new(sajcollector_config[:system_id], sajcollector_config[:api_key])
|
14
15
|
|
16
|
+
unless IPAddress.valid?(sajcollector_config[:saj])
|
17
|
+
raise ("[#{sajcollector_config[:saj]}] is not a valid IP address")
|
18
|
+
end
|
19
|
+
|
15
20
|
# Get the current day trend data from the SAJ device
|
16
21
|
c = Net::HTTP.get(sajcollector_config[:saj], '/day_trend.xml')
|
17
22
|
|
data/saj_collector.gemspec
CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
|
20
20
|
spec.add_dependency 'pvoutput', '~> 0.4.0'
|
21
|
+
spec.add_dependency 'ipaddress'
|
21
22
|
|
22
23
|
spec.add_development_dependency 'bundler'
|
23
24
|
spec.add_development_dependency 'rake', '~> 10.0'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saj_collector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johnny Willemsen
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.4.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ipaddress
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|