stekker_easee 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +1 -1
- data/.rubocop.yml +344 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +4 -1
- data/README.md +75 -0
- data/lib/easee/version.rb +1 -1
- data/lib/easee.rb +15 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e78ab3f32f01b4210e1d26b6022e5a5600720c59bca4ccb21f41109cb7add51
|
4
|
+
data.tar.gz: 914f32cb07c37b7d0260a9e6cd9baeb2c51ef0afb8fe1b55e3c25abb09219c79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e71594d0bf1f64c3d010d4d0f4df140927266bf3f8537b62c5b04b4ea375bec003bc01bc2d7f2804f26b92c4332718bcdfa8d00630ec480d4599ee7b146a3b69
|
7
|
+
data.tar.gz: 57261c2b415fc0e8bdb8a86de3684afcc554040d1539f7ab3b27cc6897ea4186a22634efb697e4d9bbe1b064bd389d6493e44bba44399afb27772ab04fb59c5f
|
data/.github/workflows/ruby.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -1 +1,344 @@
|
|
1
|
-
|
1
|
+
require:
|
2
|
+
- rubocop-rspec
|
3
|
+
|
4
|
+
AllCops:
|
5
|
+
NewCops: enable
|
6
|
+
|
7
|
+
Layout/BeginEndAlignment:
|
8
|
+
Enabled: true
|
9
|
+
|
10
|
+
Layout/BlockAlignment:
|
11
|
+
Enabled: true
|
12
|
+
EnforcedStyleAlignWith: start_of_block
|
13
|
+
|
14
|
+
Layout/EmptyLineBetweenDefs:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
18
|
+
Enabled: true
|
19
|
+
|
20
|
+
Layout/FirstArgumentIndentation:
|
21
|
+
Enabled: true
|
22
|
+
EnforcedStyle: consistent
|
23
|
+
|
24
|
+
Layout/FirstArrayElementIndentation:
|
25
|
+
Enabled: true
|
26
|
+
EnforcedStyle: consistent
|
27
|
+
|
28
|
+
Layout/FirstArrayElementLineBreak:
|
29
|
+
Enabled: true
|
30
|
+
|
31
|
+
Layout/FirstHashElementIndentation:
|
32
|
+
Enabled: true
|
33
|
+
EnforcedStyle: consistent
|
34
|
+
|
35
|
+
Layout/FirstHashElementLineBreak:
|
36
|
+
Enabled: true
|
37
|
+
|
38
|
+
Layout/FirstMethodArgumentLineBreak:
|
39
|
+
Enabled: true
|
40
|
+
|
41
|
+
Layout/FirstParameterIndentation:
|
42
|
+
Enabled: true
|
43
|
+
EnforcedStyle: consistent
|
44
|
+
|
45
|
+
Layout/LineLength:
|
46
|
+
Enabled: true
|
47
|
+
Max: 115
|
48
|
+
|
49
|
+
Layout/MultilineArrayBraceLayout:
|
50
|
+
Enabled: true
|
51
|
+
EnforcedStyle: new_line
|
52
|
+
|
53
|
+
Layout/MultilineArrayLineBreaks:
|
54
|
+
Enabled: true
|
55
|
+
|
56
|
+
Layout/MultilineHashBraceLayout:
|
57
|
+
Enabled: true
|
58
|
+
EnforcedStyle: new_line
|
59
|
+
|
60
|
+
Layout/MultilineHashKeyLineBreaks:
|
61
|
+
Enabled: true
|
62
|
+
|
63
|
+
Layout/MultilineMethodArgumentLineBreaks:
|
64
|
+
Enabled: true
|
65
|
+
|
66
|
+
Layout/MultilineMethodCallBraceLayout:
|
67
|
+
Enabled: true
|
68
|
+
EnforcedStyle: new_line
|
69
|
+
|
70
|
+
Layout/MultilineMethodCallIndentation:
|
71
|
+
Enabled: true
|
72
|
+
EnforcedStyle: indented
|
73
|
+
|
74
|
+
Layout/SpaceAroundMethodCallOperator:
|
75
|
+
Enabled: true
|
76
|
+
|
77
|
+
Layout/TrailingWhitespace:
|
78
|
+
AllowInHeredoc: true
|
79
|
+
Enabled: true
|
80
|
+
|
81
|
+
Lint/AmbiguousBlockAssociation:
|
82
|
+
Exclude:
|
83
|
+
- spec/**/*
|
84
|
+
|
85
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
86
|
+
Enabled: true
|
87
|
+
|
88
|
+
Lint/ConstantDefinitionInBlock:
|
89
|
+
Enabled: true
|
90
|
+
|
91
|
+
Lint/DeprecatedOpenSSLConstant:
|
92
|
+
Enabled: true
|
93
|
+
|
94
|
+
Lint/DuplicateBranch:
|
95
|
+
Enabled: false
|
96
|
+
|
97
|
+
Lint/DuplicateElsifCondition:
|
98
|
+
Enabled: true
|
99
|
+
|
100
|
+
Lint/DuplicateRequire:
|
101
|
+
Enabled: true
|
102
|
+
|
103
|
+
Lint/DuplicateRescueException:
|
104
|
+
Enabled: true
|
105
|
+
|
106
|
+
Lint/EmptyConditionalBody:
|
107
|
+
Enabled: true
|
108
|
+
|
109
|
+
Lint/EmptyFile:
|
110
|
+
Enabled: true
|
111
|
+
|
112
|
+
Lint/FloatComparison:
|
113
|
+
Enabled: true
|
114
|
+
|
115
|
+
Lint/IdentityComparison:
|
116
|
+
Enabled: true
|
117
|
+
|
118
|
+
Lint/MissingSuper:
|
119
|
+
Enabled: true
|
120
|
+
|
121
|
+
Lint/MixedRegexpCaptureTypes:
|
122
|
+
Enabled: true
|
123
|
+
|
124
|
+
Lint/OutOfRangeRegexpRef:
|
125
|
+
Enabled: true
|
126
|
+
|
127
|
+
Lint/RaiseException:
|
128
|
+
Enabled: true
|
129
|
+
|
130
|
+
Lint/SelfAssignment:
|
131
|
+
Enabled: true
|
132
|
+
|
133
|
+
Lint/StructNewOverride:
|
134
|
+
Enabled: true
|
135
|
+
|
136
|
+
Lint/TopLevelReturnWithArgument:
|
137
|
+
Enabled: true
|
138
|
+
|
139
|
+
Lint/TrailingCommaInAttributeDeclaration:
|
140
|
+
Enabled: true
|
141
|
+
|
142
|
+
Lint/UnreachableLoop:
|
143
|
+
Enabled: true
|
144
|
+
|
145
|
+
Lint/UselessAssignment:
|
146
|
+
Enabled: true
|
147
|
+
|
148
|
+
Lint/UselessMethodDefinition:
|
149
|
+
Enabled: true
|
150
|
+
|
151
|
+
Lint/UselessTimes:
|
152
|
+
Enabled: true
|
153
|
+
|
154
|
+
Metrics/AbcSize:
|
155
|
+
Enabled: false
|
156
|
+
|
157
|
+
Metrics/BlockLength:
|
158
|
+
Enabled: true
|
159
|
+
|
160
|
+
Metrics/ClassLength:
|
161
|
+
Enabled: false
|
162
|
+
|
163
|
+
Metrics/CyclomaticComplexity:
|
164
|
+
Max: 42
|
165
|
+
|
166
|
+
Metrics/MethodLength:
|
167
|
+
Max: 42
|
168
|
+
|
169
|
+
Metrics/ModuleLength:
|
170
|
+
Enabled: false
|
171
|
+
|
172
|
+
Metrics/ParameterLists:
|
173
|
+
CountKeywordArgs: false
|
174
|
+
Enabled: true
|
175
|
+
|
176
|
+
Metrics/PerceivedComplexity:
|
177
|
+
Max: 42
|
178
|
+
|
179
|
+
Naming/PredicateName:
|
180
|
+
Enabled: true
|
181
|
+
ForbiddenPrefixes: is_
|
182
|
+
|
183
|
+
Naming/VariableNumber:
|
184
|
+
Enabled: true
|
185
|
+
|
186
|
+
RSpec/AnyInstance:
|
187
|
+
Enabled: false
|
188
|
+
|
189
|
+
RSpec/DescribeClass:
|
190
|
+
Enabled: false
|
191
|
+
|
192
|
+
RSpec/DescribedClass:
|
193
|
+
Enabled: false
|
194
|
+
|
195
|
+
RSpec/ExampleLength:
|
196
|
+
Enabled: false
|
197
|
+
|
198
|
+
RSpec/MultipleExpectations:
|
199
|
+
Enabled: false
|
200
|
+
|
201
|
+
RSpec/NestedGroups:
|
202
|
+
Max: 4
|
203
|
+
|
204
|
+
RSpec/NoExpectationExample:
|
205
|
+
Exclude:
|
206
|
+
- spec/domain/**/*
|
207
|
+
|
208
|
+
RSpec/VerifiedDoubles:
|
209
|
+
Enabled: true
|
210
|
+
|
211
|
+
Style/AccessorGrouping:
|
212
|
+
Enabled: true
|
213
|
+
|
214
|
+
Style/ArrayCoercion:
|
215
|
+
Enabled: true
|
216
|
+
|
217
|
+
Style/AsciiComments:
|
218
|
+
Enabled: false
|
219
|
+
|
220
|
+
Style/BisectedAttrAccessor:
|
221
|
+
Enabled: true
|
222
|
+
|
223
|
+
Style/BlockDelimiters:
|
224
|
+
Enabled: true
|
225
|
+
|
226
|
+
Style/CaseLikeIf:
|
227
|
+
Enabled: true
|
228
|
+
|
229
|
+
Style/ClassAndModuleChildren:
|
230
|
+
Enabled: false
|
231
|
+
|
232
|
+
Style/CombinableLoops:
|
233
|
+
Enabled: true
|
234
|
+
|
235
|
+
Style/Documentation:
|
236
|
+
Enabled: false
|
237
|
+
|
238
|
+
Style/EmptyMethod:
|
239
|
+
EnforcedStyle: expanded
|
240
|
+
|
241
|
+
Style/ExplicitBlockArgument:
|
242
|
+
Enabled: true
|
243
|
+
|
244
|
+
Style/ExponentialNotation:
|
245
|
+
Enabled: true
|
246
|
+
|
247
|
+
Style/FrozenStringLiteralComment:
|
248
|
+
EnforcedStyle: never
|
249
|
+
|
250
|
+
Style/GlobalStdStream:
|
251
|
+
Enabled: true
|
252
|
+
|
253
|
+
Style/GuardClause:
|
254
|
+
Enabled: false
|
255
|
+
|
256
|
+
Style/HashAsLastArrayItem:
|
257
|
+
Enabled: true
|
258
|
+
|
259
|
+
Style/HashEachMethods:
|
260
|
+
Enabled: true
|
261
|
+
|
262
|
+
Style/HashLikeCase:
|
263
|
+
Enabled: true
|
264
|
+
|
265
|
+
Style/HashTransformKeys:
|
266
|
+
Enabled: true
|
267
|
+
|
268
|
+
Style/HashTransformValues:
|
269
|
+
Enabled: true
|
270
|
+
|
271
|
+
Style/IfInsideElse:
|
272
|
+
Enabled: false
|
273
|
+
|
274
|
+
Style/IfUnlessModifier:
|
275
|
+
Enabled: false
|
276
|
+
|
277
|
+
Style/KeywordParametersOrder:
|
278
|
+
Enabled: true
|
279
|
+
|
280
|
+
Style/Lambda:
|
281
|
+
EnforcedStyle: literal
|
282
|
+
|
283
|
+
Style/MultilineBlockChain:
|
284
|
+
Enabled: false
|
285
|
+
|
286
|
+
Style/NumericLiterals:
|
287
|
+
Enabled: false
|
288
|
+
|
289
|
+
Style/OptionalBooleanParameter:
|
290
|
+
Enabled: true
|
291
|
+
|
292
|
+
Style/RedundantAssignment:
|
293
|
+
Enabled: true
|
294
|
+
|
295
|
+
Style/RedundantFetchBlock:
|
296
|
+
Enabled: true
|
297
|
+
|
298
|
+
Style/RedundantFileExtensionInRequire:
|
299
|
+
Enabled: true
|
300
|
+
|
301
|
+
Style/RedundantRegexpCharacterClass:
|
302
|
+
Enabled: true
|
303
|
+
|
304
|
+
Style/RedundantRegexpEscape:
|
305
|
+
Enabled: true
|
306
|
+
|
307
|
+
Style/RedundantSelfAssignment:
|
308
|
+
Enabled: true
|
309
|
+
|
310
|
+
Style/RescueModifier:
|
311
|
+
Enabled: false
|
312
|
+
|
313
|
+
Style/SingleArgumentDig:
|
314
|
+
Enabled: true
|
315
|
+
|
316
|
+
Style/SlicingWithRange:
|
317
|
+
Enabled: true
|
318
|
+
|
319
|
+
Style/SoleNestedConditional:
|
320
|
+
Enabled: true
|
321
|
+
|
322
|
+
Style/StringConcatenation:
|
323
|
+
Enabled: true
|
324
|
+
|
325
|
+
Style/StringLiterals:
|
326
|
+
EnforcedStyle: double_quotes
|
327
|
+
|
328
|
+
Style/StringLiteralsInInterpolation:
|
329
|
+
EnforcedStyle: double_quotes
|
330
|
+
|
331
|
+
Style/SymbolArray:
|
332
|
+
EnforcedStyle: brackets
|
333
|
+
|
334
|
+
Style/TrailingCommaInArguments:
|
335
|
+
Enabled: true
|
336
|
+
EnforcedStyleForMultiline: comma
|
337
|
+
|
338
|
+
Style/TrailingCommaInArrayLiteral:
|
339
|
+
Enabled: true
|
340
|
+
EnforcedStyleForMultiline: comma
|
341
|
+
|
342
|
+
Style/TrailingCommaInHashLiteral:
|
343
|
+
Enabled: true
|
344
|
+
EnforcedStyleForMultiline: comma
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
stekker_easee (
|
4
|
+
stekker_easee (1.0.0)
|
5
5
|
activemodel
|
6
6
|
activesupport
|
7
7
|
faraday
|
@@ -49,6 +49,7 @@ GEM
|
|
49
49
|
faraday-retry (1.0.3)
|
50
50
|
faraday_middleware (1.2.0)
|
51
51
|
faraday (~> 1.0)
|
52
|
+
gem-release (2.2.2)
|
52
53
|
hashdiff (1.0.1)
|
53
54
|
i18n (1.12.0)
|
54
55
|
concurrent-ruby (~> 1.0)
|
@@ -111,8 +112,10 @@ GEM
|
|
111
112
|
|
112
113
|
PLATFORMS
|
113
114
|
arm64-darwin-22
|
115
|
+
x86_64-linux
|
114
116
|
|
115
117
|
DEPENDENCIES
|
118
|
+
gem-release (~> 2.2)
|
116
119
|
rake (~> 13.0)
|
117
120
|
rspec (~> 3.0)
|
118
121
|
rubocop (~> 1.7)
|
data/README.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# Connect to the Easee API
|
2
|
+
|
3
|
+
## How to use this without any technical knowledge
|
4
|
+
|
5
|
+
With this gem, you can connect to Easee chargers to smart charge your vehicle.
|
6
|
+
|
7
|
+
However, for an even more seamless experience, we recommend using
|
8
|
+
the [Stekker app](https://stekker.com/?utm_source=github&utm_medium=referral&utm_campaign=opensource). Our mobile app is
|
9
|
+
designed to make smart charging effortless, eliminating the need for any configuration. Simply install the app, and it
|
10
|
+
will handle the rest. Our app uses advanced algorithms to determine the best times to charge your vehicle, ensuring
|
11
|
+
you'll use the most sustainable and cheapest energy available.
|
12
|
+
|
13
|
+
## Build your own with this gem
|
14
|
+
|
15
|
+
We are proud to introduce this open source project, the Easee charger Ruby gem. As passionate ruby developers, we
|
16
|
+
believe in giving back to the community and contributing to the growth of this amazing language. That's why we are
|
17
|
+
making our Easee connection accessible to everyone through open source. Our goal is to make smart charging easier and
|
18
|
+
more accessible, and we hope that by opening up our project, we can help others in the community achieve their own
|
19
|
+
goals.
|
20
|
+
|
21
|
+
## Installation
|
22
|
+
|
23
|
+
Add this line to your application's Gemfile:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
gem "stekker_easee"
|
27
|
+
```
|
28
|
+
|
29
|
+
And then execute:
|
30
|
+
|
31
|
+
$ bundle install
|
32
|
+
|
33
|
+
Or install it yourself as:
|
34
|
+
|
35
|
+
$ gem install stekker_easee
|
36
|
+
|
37
|
+
## Usage
|
38
|
+
|
39
|
+
You can use this without Rails in the following way:
|
40
|
+
|
41
|
+
```
|
42
|
+
$ bin/console
|
43
|
+
```
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
client = Easee::Client.new(username: "username@example.com", password: "password")
|
47
|
+
# => #<Easee::Client @user_name="[FILTERED]", @password="[FILTERED]", @token_cache=#<ActiveSupport::Cache::MemoryStore entries=0, ...
|
48
|
+
|
49
|
+
# This is the charger's serial number
|
50
|
+
charger_id = "ABCDEFGH"
|
51
|
+
|
52
|
+
# Get the state of a charger
|
53
|
+
client.state(charger_id).charging?
|
54
|
+
# => false
|
55
|
+
```
|
56
|
+
|
57
|
+
## Contributing
|
58
|
+
|
59
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/stekker/easee.
|
60
|
+
|
61
|
+
## Publishing
|
62
|
+
|
63
|
+
```bash
|
64
|
+
# Bump the gem version
|
65
|
+
# See https://github.com/svenfuchs/gem-release#gem-bump
|
66
|
+
gem bump --version [major|minor|patch]
|
67
|
+
|
68
|
+
# Release the gem to rubygems.org
|
69
|
+
# See https://github.com/svenfuchs/gem-release#gem-release
|
70
|
+
gem release
|
71
|
+
|
72
|
+
# Push the commit and tag to git
|
73
|
+
git push
|
74
|
+
git push --tags
|
75
|
+
```
|
data/lib/easee/version.rb
CHANGED
data/lib/easee.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require "faraday"
|
2
|
+
require "active_support/core_ext/time/calculations"
|
3
|
+
require "active_support/isolated_execution_state"
|
4
|
+
require "active_support/core_ext/hash"
|
5
|
+
|
6
|
+
require_relative "easee/version"
|
7
|
+
require_relative "easee/client"
|
8
|
+
require_relative "easee/configuration"
|
9
|
+
require_relative "easee/errors"
|
10
|
+
require_relative "easee/meter_reading"
|
11
|
+
require_relative "easee/site"
|
12
|
+
require_relative "easee/state"
|
13
|
+
|
14
|
+
module Easee
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stekker_easee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Team Stekker
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -80,10 +80,12 @@ files:
|
|
80
80
|
- ".ruby-version"
|
81
81
|
- Gemfile
|
82
82
|
- Gemfile.lock
|
83
|
+
- README.md
|
83
84
|
- Rakefile
|
84
85
|
- bin/console
|
85
86
|
- bin/setup
|
86
87
|
- easee.gemspec
|
88
|
+
- lib/easee.rb
|
87
89
|
- lib/easee/client.rb
|
88
90
|
- lib/easee/configuration.rb
|
89
91
|
- lib/easee/errors.rb
|