huginn_renault_ze_agent 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/renault_ze/renault_ze_connect.rb +10 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e05902dbefc48961c1a6392c562c862e34eec4b2855931fe9cf1ef720346148
|
4
|
+
data.tar.gz: 82c7cf393d268bc1761191a113c224c63801686c72a6d3ba17d4a7a11ad9f4aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa6e5dedec4dd05c117dd253d5e2b8840e9d0f513ce493272daf97036f979e54a15407370a4a46c63753461d9ffb9664aafb9e80392b4c18b0d7d201903acc0a
|
7
|
+
data.tar.gz: f938c71489e3dc565c4a13a240bfab108b0b915f649625d85bbecf3241fd649b49b2078e9b7a852f5c70a37359654b3f2d6e7675e964783c0da539a10aa8c7ad
|
@@ -8,7 +8,11 @@ module RenaultZE
|
|
8
8
|
def login
|
9
9
|
response = HTTParty.post(
|
10
10
|
"https://www.services.renault-ze.com/api/user/login",
|
11
|
-
headers: {
|
11
|
+
headers: {
|
12
|
+
"Accept": "application/json",
|
13
|
+
"Content-Type": "application/json",
|
14
|
+
"User-Agent": "Huginn/2019"
|
15
|
+
},
|
12
16
|
body: {username: @username, password: @password}.to_json
|
13
17
|
)
|
14
18
|
raise "Login - Unexpected response code: #{response}" unless response.code == 200
|
@@ -26,7 +30,11 @@ module RenaultZE
|
|
26
30
|
|
27
31
|
response = HTTParty.get(
|
28
32
|
"https://www.services.renault-ze.com/api/vehicle/#{creds[:vin]}/battery",
|
29
|
-
headers: {
|
33
|
+
headers: {
|
34
|
+
"Accept": "application/json",
|
35
|
+
"Authorization": "Bearer #{creds[:token]}",
|
36
|
+
"User-Agent": "Huginn/2019"
|
37
|
+
}
|
30
38
|
)
|
31
39
|
raise "Battery - Unexpected response code: #{response}" unless response.code == 200
|
32
40
|
|