alpha_ess 1.2 → 1.2.1
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/alpha_ess.gemspec +1 -1
- data/lib/alpha_ess.rb +11 -9
- metadata +1 -2
- data/alpha_ess-1.1.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fed25ff583048344b8da4a15dcd92510abf9d69d5adec2e0da030bf23478ef35
|
4
|
+
data.tar.gz: b2cba2ad069290c82b1e4849ac4c1ce588c19abca72a62fcdf4458033e36f365
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86208124094f59312e88bf877c29b946da0fbc0b865a77e3d1948c110d832de8712b3a420d08e499bfc615ab38ab20c41d970825d1194efa01a0c29b22ae6cf5
|
7
|
+
data.tar.gz: cf071266cb4443e6f83918a0b936c5f6d269fb20d796578782b064d3d73b13b802ef19a5dad6bdab45edbf2ccea88e83f25488b644c45006abbcf89922d29a09
|
data/README.md
CHANGED
data/alpha_ess.gemspec
CHANGED
data/lib/alpha_ess.rb
CHANGED
@@ -26,12 +26,13 @@ class AlphaEss
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def get_last_power_data()
|
29
|
-
body = {
|
30
|
-
|
31
|
-
|
32
|
-
}
|
33
|
-
url = "https://cloud.alphaess.com/api/ESS/GetLastPowerDataBySN"
|
34
|
-
res = HTTParty.post(url, headers: header(), body: body.to_json)
|
29
|
+
#body = {
|
30
|
+
# "sys_sn" => @serial,
|
31
|
+
# "noLoading" => true
|
32
|
+
#}
|
33
|
+
url = "https://cloud.alphaess.com/api/ESS/GetLastPowerDataBySN?sys_sn=#{@serial}&noLoading=true"
|
34
|
+
#res = HTTParty.post(url, headers: header(), body: body.to_json)
|
35
|
+
res = HTTParty.get(url, headers: header())
|
35
36
|
res.parsed_response["data"]
|
36
37
|
end
|
37
38
|
|
@@ -102,10 +103,11 @@ class AlphaEss
|
|
102
103
|
"username" => @username,
|
103
104
|
"password" => @password
|
104
105
|
}
|
105
|
-
|
106
|
+
header = {
|
106
107
|
"Accept" => "application/json",
|
107
108
|
"Content-Type" => "application/json;charset=UTF-8"
|
108
|
-
}.update(secure_header_addon())
|
109
|
+
}.update(secure_header_addon())
|
110
|
+
res = HTTParty.post(url, headers: header, body: body.to_json)
|
109
111
|
@token = res.parsed_response["data"]["AccessToken"]
|
110
112
|
@token_valid_to = Time.now.to_i+36000
|
111
113
|
save_token()
|
@@ -115,7 +117,7 @@ class AlphaEss
|
|
115
117
|
# thanks to https://github.com/CharlesGillanders
|
116
118
|
t = Time.now.to_i
|
117
119
|
{
|
118
|
-
"authtimestamp" => t,
|
120
|
+
"authtimestamp" => t.to_s,
|
119
121
|
"authsignature" => "#{AUTHPREFIX}#{Digest::SHA2.new(512).hexdigest("#{AUTHCONSTANT}#{t}")}#{AUTHSUFFIX}"
|
120
122
|
}
|
121
123
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alpha_ess
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oliver Gaida
|
@@ -46,7 +46,6 @@ extra_rdoc_files: []
|
|
46
46
|
files:
|
47
47
|
- LICENSE.md
|
48
48
|
- README.md
|
49
|
-
- alpha_ess-1.1.gem
|
50
49
|
- alpha_ess.gemspec
|
51
50
|
- images/b965404834760626afe73785811995faa1629d2ab66a53f966443fbf22463a67.png
|
52
51
|
- lib/alpha_ess.rb
|
data/alpha_ess-1.1.gem
DELETED
Binary file
|