stekker_zaptec 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 07eff5379522b2cb0f158f799900600140a782ba37b8acbc65f28581972dca35
4
+ data.tar.gz: fc8c327e0ce16265166db25d40c1e27720d70b749a6a5883ec5d1f8e7d32a04d
5
+ SHA512:
6
+ metadata.gz: 492cb84de495ba09a60ace663530cf90c8801d43602571eeda763a40a9af7163d694dd57a3b38725a6d2f3e81997f2d4c45a408d2223842ea62ff5e89446bca0
7
+ data.tar.gz: 229002af0645745ca66b834ff6b72a1f2c7e82c8782471f2b64586fdda942ae8e8ec151fbe21ca14713792817217bbf3d93ea4407afea883d28c7e70e46bffda
@@ -0,0 +1,23 @@
1
+ name: "Ruby"
2
+ on:
3
+ push:
4
+ branches: [ "main" ]
5
+ pull_request:
6
+ branches: [ "main" ]
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+
11
+ env:
12
+ RAILS_ENV: test
13
+ steps:
14
+ - name: Checkout code
15
+ uses: actions/checkout@v3
16
+
17
+ - name: Install Ruby and gems
18
+ uses: ruby/setup-ruby@ee2113536afb7f793eed4ce60e8d3b26db912da4
19
+ with:
20
+ bundler-cache: true
21
+
22
+ - name: Run tests and Rubocop
23
+ run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,54 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ .generators
11
+ .rspec-failures
12
+ .rspec_status
13
+
14
+ # Ignore the default SQLite database.
15
+ /db/*.sqlite3
16
+ /db/*.sqlite3-journal
17
+
18
+ # Ignore all logfiles and tempfiles.
19
+ /log/*
20
+ /tmp/*
21
+ !/log/.keep
22
+ !/tmp/.keep
23
+
24
+ *.gem
25
+
26
+ # Ignore uploaded files in development
27
+ /storage/*
28
+ !/storage/.keep
29
+
30
+ /node_modules
31
+ /yarn-error.log
32
+
33
+ .byebug_history
34
+
35
+ # Ignore master key for decrypting credentials and more.
36
+ /config/master.key
37
+
38
+ stekker-erd.pdf
39
+
40
+ /node_modules
41
+ /yarn-error.log
42
+ yarn-debug.log*
43
+ .yarn-integrity
44
+
45
+ config/initializers/better_errors.rb
46
+ coverage
47
+
48
+ /config/credentials/production.key
49
+ /config/credentials/staging.key
50
+
51
+ /app/assets/builds/*
52
+ !/app/assets/builds/.keep
53
+
54
+ .projections.json
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,383 @@
1
+ require:
2
+ - rubocop-rails
3
+ - rubocop-rspec
4
+
5
+ AllCops:
6
+ NewCops: enable
7
+ Exclude:
8
+ - "vendor/**/*"
9
+ - "bin/**/*"
10
+ - "node_modules/**/*"
11
+ - "db/schema.rb"
12
+ - "db/sequent_schema.rb"
13
+ - "db/seeds.rb"
14
+ - "db/seed/**/*"
15
+ - "db/migrate/**/*"
16
+
17
+ Rails/EnvironmentVariableAccess:
18
+ AllowReads: true
19
+
20
+ Rails/HasAndBelongsToMany:
21
+ Enabled: false
22
+
23
+ RSpec/VerifiedDoubles:
24
+ Enabled: true
25
+ Exclude:
26
+ - "spec/components/previews/**/*"
27
+
28
+ Style/MultilineBlockChain:
29
+ Enabled: false
30
+
31
+ RSpec/NoExpectationExample:
32
+ Exclude:
33
+ - "spec/domain/**/*"
34
+
35
+ Style/SymbolArray:
36
+ EnforcedStyle: brackets
37
+
38
+ Metrics/ParameterLists:
39
+ Enabled: true
40
+ CountKeywordArgs: false
41
+
42
+ Style/NumericLiterals:
43
+ Enabled: false
44
+
45
+ Style/FrozenStringLiteralComment:
46
+ EnforcedStyle: never
47
+
48
+ Style/GuardClause:
49
+ Enabled: false
50
+
51
+ Style/ClassAndModuleChildren:
52
+ Enabled: false
53
+
54
+ Lint/DuplicateBranch:
55
+ Enabled: false
56
+
57
+ Lint/RaiseException:
58
+ Enabled: true
59
+
60
+ Rails/SkipsModelValidations:
61
+ Enabled: false
62
+
63
+ Lint/StructNewOverride:
64
+ Enabled: true
65
+
66
+ Rails:
67
+ Enabled: true
68
+
69
+ Style/AccessorGrouping:
70
+ Enabled: true
71
+
72
+ Style/IfInsideElse:
73
+ Enabled: false
74
+
75
+ Rails/LexicallyScopedActionFilter:
76
+ Enabled: false
77
+
78
+ Style/BisectedAttrAccessor:
79
+ Enabled: true
80
+ Style/RedundantAssignment:
81
+ Enabled: true
82
+ Rails/ActiveRecordCallbacksOrder:
83
+ Enabled: true
84
+ Rails/FindById:
85
+ Enabled: true
86
+ Rails/Inquiry:
87
+ Enabled: false
88
+ Rails/MailerName:
89
+ Enabled: true
90
+ Rails/MatchRoute:
91
+ Enabled: true
92
+ Rails/NegateInclude:
93
+ Enabled: true
94
+ Rails/Pluck:
95
+ Enabled: true
96
+ Rails/PluckInWhere:
97
+ Enabled: true
98
+ Rails/RenderInline:
99
+ Enabled: true
100
+ Rails/RenderPlainText:
101
+ Enabled: true
102
+ Rails/ShortI18n:
103
+ Enabled: true
104
+ Rails/WhereExists:
105
+ Enabled: true
106
+ Lint/DuplicateElsifCondition:
107
+ Enabled: true
108
+ Style/ArrayCoercion:
109
+ Enabled: true
110
+ Style/CaseLikeIf:
111
+ Enabled: true
112
+ Style/HashAsLastArrayItem:
113
+ Enabled: true
114
+ Style/HashLikeCase:
115
+ Enabled: true
116
+ Style/RedundantFileExtensionInRequire:
117
+ Enabled: true
118
+
119
+ # Allow emoji in comments
120
+ Style/AsciiComments:
121
+ Enabled: false
122
+
123
+ Naming/PredicateName:
124
+ Enabled: true
125
+ ForbiddenPrefixes:
126
+ is_
127
+
128
+ Naming/VariableNumber:
129
+ Enabled: true
130
+ Exclude:
131
+ - "spec/**/*"
132
+ - "gems/we_connect/spec//**/*"
133
+
134
+ Style/EmptyMethod:
135
+ EnforcedStyle: expanded
136
+
137
+ Style/StringLiterals:
138
+ EnforcedStyle: double_quotes
139
+
140
+ Style/StringLiteralsInInterpolation:
141
+ EnforcedStyle: double_quotes
142
+ Exclude:
143
+ - "spec/**/*"
144
+
145
+ Layout/TrailingWhitespace:
146
+ Enabled: true
147
+ AllowInHeredoc: true
148
+
149
+ Metrics/ClassLength:
150
+ Enabled: false
151
+
152
+ Layout/LineLength:
153
+ Enabled: true
154
+ Max: 115 # Readable github.com diffs
155
+
156
+ Style/Documentation:
157
+ Enabled: false
158
+
159
+ Layout/EmptyLineBetweenDefs:
160
+ Enabled: false
161
+
162
+ Metrics/MethodLength:
163
+ Max: 42
164
+ Exclude:
165
+ - "**/spec/**/*"
166
+
167
+ Metrics/BlockLength:
168
+ Exclude:
169
+ - "**/spec/**/*"
170
+ - "config/routes.rb"
171
+ - "**/*.gemspec"
172
+
173
+ Lint/UselessAssignment:
174
+ Exclude:
175
+ - "spec/**/*"
176
+
177
+ Style/HashEachMethods:
178
+ Enabled: true
179
+
180
+ Style/HashTransformKeys:
181
+ Enabled: true
182
+
183
+ Style/HashTransformValues:
184
+ Enabled: true
185
+
186
+ Layout/SpaceAroundMethodCallOperator:
187
+ Enabled: true
188
+
189
+ Style/ExponentialNotation:
190
+ Enabled: true
191
+
192
+ Layout/EmptyLinesAroundAttributeAccessor:
193
+ Enabled: true
194
+
195
+ Lint/DeprecatedOpenSSLConstant:
196
+ Enabled: true
197
+
198
+ Style/SlicingWithRange:
199
+ Enabled: true
200
+
201
+ Style/IfUnlessModifier:
202
+ Enabled: false
203
+
204
+ Lint/MixedRegexpCaptureTypes:
205
+ Enabled: true
206
+
207
+ Style/RedundantFetchBlock:
208
+ Enabled: true
209
+
210
+ Style/RedundantRegexpCharacterClass:
211
+ Enabled: true
212
+
213
+ Style/RedundantRegexpEscape:
214
+ Enabled: true
215
+
216
+ Metrics/CyclomaticComplexity:
217
+ Max: 42
218
+
219
+ Metrics/PerceivedComplexity:
220
+ Max: 42
221
+
222
+ Style/RescueModifier:
223
+ Enabled: false
224
+
225
+ Style/Lambda:
226
+ EnforcedStyle: literal
227
+
228
+ Style/BlockDelimiters:
229
+ Enabled: true
230
+
231
+ Style/SingleArgumentDig: # (new in 0.89)
232
+ Enabled: true
233
+
234
+ Lint/BinaryOperatorWithIdenticalOperands: # (new in 0.89)
235
+ Enabled: true
236
+ Lint/DuplicateRequire: # (new in 0.90)
237
+ Enabled: true
238
+ Lint/DuplicateRescueException: # (new in 0.89)
239
+ Enabled: true
240
+ Lint/EmptyConditionalBody: # (new in 0.89)
241
+ Enabled: true
242
+ Lint/EmptyFile: # (new in 0.90)
243
+ Enabled: true
244
+ Lint/FloatComparison: # (new in 0.89)
245
+ Enabled: true
246
+ Lint/MissingSuper: # (new in 0.89)
247
+ Enabled: true
248
+ Lint/OutOfRangeRegexpRef: # (new in 0.89)
249
+ Enabled: true
250
+ Lint/SelfAssignment: # (new in 0.89)
251
+ Enabled: true
252
+ Lint/TopLevelReturnWithArgument: # (new in 0.89)
253
+ Enabled: true
254
+ Lint/TrailingCommaInAttributeDeclaration: # (new in 0.90)
255
+ Enabled: true
256
+ Lint/UnreachableLoop: # (new in 0.89)
257
+ Enabled: true
258
+ Lint/UselessMethodDefinition: # (new in 0.90)
259
+ Enabled: true
260
+ Style/CombinableLoops: # (new in 0.90)
261
+ Enabled: true
262
+ Style/ExplicitBlockArgument: # (new in 0.89)
263
+ Enabled: true
264
+ Style/GlobalStdStream: # (new in 0.89)
265
+ Enabled: true
266
+ Style/KeywordParametersOrder: # (new in 0.90)
267
+ Enabled: true
268
+ Style/OptionalBooleanParameter: # (new in 0.89)
269
+ Enabled: true
270
+ Style/RedundantSelfAssignment: # (new in 0.90)
271
+ Enabled: true
272
+ Style/SoleNestedConditional: # (new in 0.89)
273
+ Enabled: true
274
+ Style/StringConcatenation: # (new in 0.89)
275
+ Enabled: true
276
+
277
+ Metrics/ModuleLength:
278
+ Enabled: false
279
+
280
+ Layout/BeginEndAlignment: # (new in 0.91)
281
+ Enabled: true
282
+ Lint/ConstantDefinitionInBlock: # (new in 0.91)
283
+ Enabled: true
284
+ Lint/IdentityComparison: # (new in 0.91)
285
+ Enabled: true
286
+ Lint/UselessTimes: # (new in 0.91)
287
+ Enabled: true
288
+ Rails/AfterCommitOverride: # (new in 2.8)
289
+ Enabled: true
290
+ Rails/SquishedSQLHeredocs: # (new in 2.8)
291
+ Enabled: true
292
+ Rails/WhereNot: # (new in 2.8)
293
+ Enabled: true
294
+ Metrics/AbcSize:
295
+ Enabled: false
296
+
297
+ Rails/UnknownEnv:
298
+ Environments:
299
+ - production
300
+ - development
301
+ - test
302
+ - staging
303
+
304
+ RSpec/DescribeClass:
305
+ Enabled: false
306
+ RSpec/DescribedClass:
307
+ Enabled: false
308
+ RSpec/NestedGroups:
309
+ Max: 4
310
+ RSpec/MultipleExpectations:
311
+ Enabled: false
312
+ RSpec/ExampleLength:
313
+ Enabled: false
314
+ RSpec/AnyInstance:
315
+ Enabled: false
316
+
317
+ # No translations needed in Admin, for now:
318
+ Rails/I18nLocaleTexts:
319
+ Exclude:
320
+ - "app/controllers/admin/**/*"
321
+
322
+ ##
323
+ # Multi-line formatting (hashes)
324
+ ##
325
+ Layout/FirstHashElementLineBreak:
326
+ Enabled: true
327
+
328
+ Layout/FirstHashElementIndentation:
329
+ Enabled: true
330
+ EnforcedStyle: consistent
331
+
332
+ Layout/MultilineHashBraceLayout:
333
+ Enabled: true
334
+ EnforcedStyle: new_line
335
+
336
+ Layout/MultilineHashKeyLineBreaks:
337
+ Enabled: true
338
+
339
+ ##
340
+ # Multi-line formatting (array)
341
+ ##
342
+ Layout/FirstArrayElementLineBreak:
343
+ Enabled: true
344
+
345
+ Layout/FirstArrayElementIndentation:
346
+ Enabled: true
347
+ EnforcedStyle: consistent
348
+
349
+ Layout/MultilineArrayBraceLayout:
350
+ Enabled: true
351
+ EnforcedStyle: new_line
352
+
353
+ Layout/MultilineArrayLineBreaks:
354
+ Enabled: true
355
+
356
+ ##
357
+ # Multi-line formatting (methods/arguments/blocks)
358
+ ##
359
+ Layout/FirstMethodArgumentLineBreak:
360
+ Enabled: true
361
+
362
+ Layout/FirstArgumentIndentation:
363
+ Enabled: true
364
+ EnforcedStyle: consistent
365
+
366
+ Layout/FirstParameterIndentation:
367
+ Enabled: true
368
+ EnforcedStyle: consistent
369
+
370
+ Layout/MultilineMethodCallBraceLayout:
371
+ Enabled: true
372
+ EnforcedStyle: new_line
373
+
374
+ Layout/MultilineMethodArgumentLineBreaks:
375
+ Enabled: true
376
+
377
+ Layout/MultilineMethodCallIndentation:
378
+ Enabled: true
379
+ EnforcedStyle: indented
380
+
381
+ Layout/BlockAlignment:
382
+ Enabled: true
383
+ EnforcedStyleAlignWith: start_of_block
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.0.2
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in zaptec.gemspec
4
+ gemspec
5
+
6
+ gem "jwt", "~> 2.6"
7
+ gem "rake", "~> 13.0"
8
+ gem "rspec", "~> 3.0"
9
+ gem "rubocop", "~> 1.7"
10
+ gem "rubocop-rails", "~> 2.17"
11
+ gem "rubocop-rspec", "~> 2.10"
12
+ gem "timecop", "~> 0.9"
13
+ gem "webmock", "~> 3.18"
data/Gemfile.lock ADDED
@@ -0,0 +1,146 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ stekker_zaptec (1.0.0)
5
+ activemodel
6
+ activesupport
7
+ faraday
8
+ faraday-cookie_jar
9
+ faraday-detailed_logger
10
+ faraday_middleware
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ activemodel (7.0.4.2)
16
+ activesupport (= 7.0.4.2)
17
+ activesupport (7.0.4.2)
18
+ concurrent-ruby (~> 1.0, >= 1.0.2)
19
+ i18n (>= 1.6, < 2)
20
+ minitest (>= 5.1)
21
+ tzinfo (~> 2.0)
22
+ addressable (2.8.1)
23
+ public_suffix (>= 2.0.2, < 6.0)
24
+ ast (2.4.2)
25
+ concurrent-ruby (1.2.0)
26
+ crack (0.4.5)
27
+ rexml
28
+ diff-lcs (1.5.0)
29
+ domain_name (0.5.20190701)
30
+ unf (>= 0.0.5, < 1.0.0)
31
+ faraday (1.10.3)
32
+ faraday-em_http (~> 1.0)
33
+ faraday-em_synchrony (~> 1.0)
34
+ faraday-excon (~> 1.1)
35
+ faraday-httpclient (~> 1.0)
36
+ faraday-multipart (~> 1.0)
37
+ faraday-net_http (~> 1.0)
38
+ faraday-net_http_persistent (~> 1.0)
39
+ faraday-patron (~> 1.0)
40
+ faraday-rack (~> 1.0)
41
+ faraday-retry (~> 1.0)
42
+ ruby2_keywords (>= 0.0.4)
43
+ faraday-cookie_jar (0.0.7)
44
+ faraday (>= 0.8.0)
45
+ http-cookie (~> 1.0.0)
46
+ faraday-detailed_logger (2.5.0)
47
+ faraday (>= 0.16, < 3)
48
+ faraday-em_http (1.0.0)
49
+ faraday-em_synchrony (1.0.0)
50
+ faraday-excon (1.1.0)
51
+ faraday-httpclient (1.0.1)
52
+ faraday-multipart (1.0.4)
53
+ multipart-post (~> 2)
54
+ faraday-net_http (1.0.1)
55
+ faraday-net_http_persistent (1.2.0)
56
+ faraday-patron (1.0.0)
57
+ faraday-rack (1.0.0)
58
+ faraday-retry (1.0.3)
59
+ faraday_middleware (1.2.0)
60
+ faraday (~> 1.0)
61
+ hashdiff (1.0.1)
62
+ http-cookie (1.0.5)
63
+ domain_name (~> 0.5)
64
+ i18n (1.12.0)
65
+ concurrent-ruby (~> 1.0)
66
+ json (2.6.3)
67
+ jwt (2.6.0)
68
+ minitest (5.17.0)
69
+ multipart-post (2.3.0)
70
+ parallel (1.22.1)
71
+ parser (3.2.0.0)
72
+ ast (~> 2.4.1)
73
+ public_suffix (5.0.1)
74
+ rack (3.0.4.1)
75
+ rainbow (3.1.1)
76
+ rake (13.0.6)
77
+ regexp_parser (2.6.2)
78
+ rexml (3.2.5)
79
+ rspec (3.12.0)
80
+ rspec-core (~> 3.12.0)
81
+ rspec-expectations (~> 3.12.0)
82
+ rspec-mocks (~> 3.12.0)
83
+ rspec-core (3.12.0)
84
+ rspec-support (~> 3.12.0)
85
+ rspec-expectations (3.12.2)
86
+ diff-lcs (>= 1.2.0, < 2.0)
87
+ rspec-support (~> 3.12.0)
88
+ rspec-mocks (3.12.3)
89
+ diff-lcs (>= 1.2.0, < 2.0)
90
+ rspec-support (~> 3.12.0)
91
+ rspec-support (3.12.0)
92
+ rubocop (1.44.1)
93
+ json (~> 2.3)
94
+ parallel (~> 1.10)
95
+ parser (>= 3.2.0.0)
96
+ rainbow (>= 2.2.2, < 4.0)
97
+ regexp_parser (>= 1.8, < 3.0)
98
+ rexml (>= 3.2.5, < 4.0)
99
+ rubocop-ast (>= 1.24.1, < 2.0)
100
+ ruby-progressbar (~> 1.7)
101
+ unicode-display_width (>= 2.4.0, < 3.0)
102
+ rubocop-ast (1.24.1)
103
+ parser (>= 3.1.1.0)
104
+ rubocop-capybara (2.17.0)
105
+ rubocop (~> 1.41)
106
+ rubocop-rails (2.17.4)
107
+ activesupport (>= 4.2.0)
108
+ rack (>= 1.1)
109
+ rubocop (>= 1.33.0, < 2.0)
110
+ rubocop-rspec (2.18.1)
111
+ rubocop (~> 1.33)
112
+ rubocop-capybara (~> 2.17)
113
+ ruby-progressbar (1.11.0)
114
+ ruby2_keywords (0.0.5)
115
+ timecop (0.9.6)
116
+ tzinfo (2.0.6)
117
+ concurrent-ruby (~> 1.0)
118
+ unf (0.1.4)
119
+ unf_ext
120
+ unf_ext (0.0.8.2)
121
+ unicode-display_width (2.4.2)
122
+ webmock (3.18.1)
123
+ addressable (>= 2.8.0)
124
+ crack (>= 0.3.2)
125
+ hashdiff (>= 0.4.0, < 2.0.0)
126
+
127
+ PLATFORMS
128
+ arm64-darwin-20
129
+ arm64-darwin-21
130
+ arm64-darwin-22
131
+ x86_64-darwin-21
132
+ x86_64-linux
133
+
134
+ DEPENDENCIES
135
+ jwt (~> 2.6)
136
+ rake (~> 13.0)
137
+ rspec (~> 3.0)
138
+ rubocop (~> 1.7)
139
+ rubocop-rails (~> 2.17)
140
+ rubocop-rspec (~> 2.10)
141
+ stekker_zaptec!
142
+ timecop (~> 0.9)
143
+ webmock (~> 3.18)
144
+
145
+ BUNDLED WITH
146
+ 2.2.22
data/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # Connect to the Zaptec API
2
+
3
+ ## How to use this without any technical knowledge
4
+
5
+ With this gem, you can connect to Zaptec 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
+ ![63d23f74d30e66e9c6fd9b1e_IMG_1742](https://user-images.githubusercontent.com/167882/216616346-ff619fe7-8d27-45b2-b420-725a9073d67b.jpeg)
14
+
15
+ ## Build your own with this gem
16
+
17
+ We are proud to introduce this open source project, the Zaptec charger Ruby gem. As passionate ruby developers, we
18
+ believe in giving back to the community and contributing to the growth of this amazing language. That's why we are
19
+ making our Zaptec connection accessible to everyone through open source. Our goal is to make smart charging easier and
20
+ more accessible, and we hope that by opening up our project, we can help others in the community achieve their own
21
+ goals.
22
+
23
+ ## Installation
24
+
25
+ Add this line to your application's Gemfile:
26
+
27
+ gem "zaptec"
28
+ ```
29
+
30
+ ```ruby
31
+ And then execute:
32
+
33
+ $ bundle install
34
+
35
+ Or install it yourself as:
36
+
37
+ $ gem install zaptec
38
+
39
+ ## Usage
40
+
41
+ You can use this without Rails in the following way:
42
+
43
+ ```
44
+ $ bin/console
45
+ ```
46
+
47
+ ```ruby
48
+ require "zaptec"
49
+
50
+ client = Zaptec::Client.new
51
+ client.login("username@example.com", "password")
52
+ # #<Zaptec::Credentials:0x000000011c35d708
53
+
54
+ # Get a list of chargers
55
+ client.chargers
56
+ # => [#<Zaptec::Charger:0x000000011c47df20 @device_id="ZAP049387", @device_type=4, @id="de522271-91f5-45b8-916b-...", ...
57
+
58
+ # Get the state of a charger
59
+ id = client.chargers.first.id
60
+ device_type_apollo = 4
61
+ client.state(id, device_type_apollo).online?
62
+ # => true
63
+ ```
64
+
65
+ ## Contributing
66
+
67
+ Bug reports and pull requests are welcome on GitHub at https://github.com/stekker/zaptec.
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ require "rubocop/rake_task"
7
+
8
+ RuboCop::RakeTask.new
9
+
10
+ task default: [:spec, :rubocop]