smartcar 3.6.0 → 3.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -8
- data/lib/smartcar/utils.rb +2 -0
- data/lib/smartcar/vehicle.rb +18 -0
- data/lib/smartcar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1c4483d2719b243be93876bec15f34de1d2787308bb6a44383a9e0bbf0db00a
|
4
|
+
data.tar.gz: f4774a7225f67e3ddae7d4d935fbddf9cf772994ba5a7d236c3c2e8daf5ed222
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a3c96cb014e4ad5b5797e0a8a4d74599f849f861fccee1739c916a02e77c53c105853a496a3f87b7e94e34c66046e0b49c0bc1e63b13da4a8fac6cf82c2c961
|
7
|
+
data.tar.gz: 4a3d22bb0334c947b39dcd43c2950e35c1b8453ddd3f731ae589f1dfbdbbd254cae671668f712387b455328fc0e15c25e925603e90be8fff2330ff31c9412936
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
smartcar (3.
|
4
|
+
smartcar (3.7.0)
|
5
5
|
oauth2 (~> 1.4)
|
6
6
|
recursive-open-struct (~> 1.1.3)
|
7
7
|
|
@@ -20,25 +20,25 @@ GEM
|
|
20
20
|
rexml
|
21
21
|
diff-lcs (1.5.0)
|
22
22
|
docile (1.4.0)
|
23
|
-
faraday (2.
|
24
|
-
faraday-net_http (
|
23
|
+
faraday (2.7.10)
|
24
|
+
faraday-net_http (>= 2.0, < 3.1)
|
25
25
|
ruby2_keywords (>= 0.0.4)
|
26
|
-
faraday-net_http (
|
26
|
+
faraday-net_http (3.0.2)
|
27
27
|
hashdiff (1.0.1)
|
28
|
-
jwt (2.
|
28
|
+
jwt (2.7.1)
|
29
29
|
multi_json (1.15.0)
|
30
30
|
multi_xml (0.6.0)
|
31
|
-
oauth2 (1.4.
|
31
|
+
oauth2 (1.4.11)
|
32
32
|
faraday (>= 0.17.3, < 3.0)
|
33
33
|
jwt (>= 1.0, < 3.0)
|
34
34
|
multi_json (~> 1.3)
|
35
35
|
multi_xml (~> 0.5)
|
36
|
-
rack (>= 1.2, <
|
36
|
+
rack (>= 1.2, < 4)
|
37
37
|
parallel (1.21.0)
|
38
38
|
parser (3.1.0.0)
|
39
39
|
ast (~> 2.4.1)
|
40
40
|
public_suffix (4.0.6)
|
41
|
-
rack (
|
41
|
+
rack (3.0.8)
|
42
42
|
rainbow (3.1.1)
|
43
43
|
rake (12.3.3)
|
44
44
|
readapt (1.4.3)
|
data/lib/smartcar/utils.rb
CHANGED
@@ -125,6 +125,8 @@ module Smartcar
|
|
125
125
|
# Adding this because else it would become tires_pressure
|
126
126
|
return :tire_pressure if path == '/tires/pressure'
|
127
127
|
|
128
|
+
return :lock_status if path == '/security'
|
129
|
+
|
128
130
|
path.split('/').reject(&:empty?).join('_').to_sym
|
129
131
|
end
|
130
132
|
|
data/lib/smartcar/vehicle.rb
CHANGED
@@ -54,6 +54,13 @@ module Smartcar
|
|
54
54
|
vin: { path: proc { |id| "/vehicles/#{id}/vin" } },
|
55
55
|
get_charge_limit: { path: proc { |id| "/vehicles/#{id}/charge/limit" } },
|
56
56
|
disconnect!: { type: :delete, path: proc { |id| "/vehicles/#{id}/application" } },
|
57
|
+
lock_status: {
|
58
|
+
path: proc { |id| "/vehicles/#{id}/security" },
|
59
|
+
aliases: {
|
60
|
+
'isLocked' => 'is_locked',
|
61
|
+
'chargingPort' => 'charging_port'
|
62
|
+
}
|
63
|
+
},
|
57
64
|
lock!: { type: :post, path: proc { |id| "/vehicles/#{id}/security" }, body: { action: 'LOCK' } },
|
58
65
|
unlock!: { type: :post, path: proc { |id| "/vehicles/#{id}/security" }, body: { action: 'UNLOCK' } },
|
59
66
|
start_charge!: { type: :post, path: proc { |id| "/vehicles/#{id}/charge" }, body: { action: 'START' } },
|
@@ -172,6 +179,17 @@ module Smartcar
|
|
172
179
|
# @return [OpenStruct] And object representing the JSON response mentioned in https://smartcar.com/docs/api#get-vin
|
173
180
|
# and a meta attribute with the relevant items from response headers.
|
174
181
|
|
182
|
+
# @!method lock_status()
|
183
|
+
# Returns the lock status for a vehicle and the open status of its doors, windows, storage units,
|
184
|
+
# sunroof and charging port where available. The open status array(s) will be empty if a vehicle
|
185
|
+
# has partial support. The request will error if lock status can not be retrieved from the vehicle or
|
186
|
+
# the brand is not supported.
|
187
|
+
#
|
188
|
+
# API Documentation https://smartcar.com/docs/api#get-security
|
189
|
+
#
|
190
|
+
# @return [OpenStruct] And object representing the JSON response mentioned in https://smartcar.com/docs/api#get-security
|
191
|
+
# and a meta attribute with the relevant items from response headers.
|
192
|
+
|
175
193
|
# NOTES :
|
176
194
|
# - We only generate the methods where there is no query string or additional options considering thats
|
177
195
|
# the majority, for all the ones that require parameters, write them separately.
|
data/lib/smartcar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smartcar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ashwin Subramanian
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|