alula-ruby 1.10.5 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/VERSION.md +2 -0
- data/alula.gemspec +6 -6
- data/lib/alula/helpers/device_helpers/attribute_translations_helper.rb +40 -0
- data/lib/alula/helpers/device_helpers/program_id_helper.rb +103 -0
- data/lib/alula/resources/device.rb +37 -33
- data/lib/alula/resources/video/device.rb +2 -2
- data/lib/alula/version.rb +1 -1
- data/lib/alula.rb +2 -1
- metadata +15 -14
- data/lib/alula/helpers/device_attribute_translations.rb +0 -68
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85fb1b113e8dfd4a96634c155ee2aa2a7824135bda2ae967199d8eedde5b9ba9
|
4
|
+
data.tar.gz: 2478e273b0311f9fb6a448d7608cd2617efd535ab1abee08f922ae9609fe690d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e84964a36d93e60a171e3f27e28ffcb33ddb73bc03648224bf38372b552e03cc7f3e72e706be81c5313fe9960215a9fa39e22e9fa4f5ecdfe0eaa3b0743be867
|
7
|
+
data.tar.gz: 5cc072f2a8b1456de0f91fdba0cfa46bbef56efbc837e66b6b943f7c39919c7584b75e03e15b743b7c953b6c036b7c68e13c6528a4b204da223e27e02d54a3fb
|
data/README.md
CHANGED
@@ -440,6 +440,11 @@ Note: You do need to be authorized against our private ECR registry. This is man
|
|
440
440
|
|
441
441
|
Occasionally under heavy use the dockerized API may lose or drop its databases, resulting in the test suite erroring completly and very quickly. To fix this simply restart the API with `docker-compose -f alula-docker-compose.yml down && docker-compose -f alula-docker-compose.yml up -d`
|
442
442
|
|
443
|
+
### Adding a new device
|
444
|
+
|
445
|
+
Optional: When a new device is added, methods for it can be exposed inside lib/alula/helpers/device_helpers/program_id_helper.rb. The device ID can be added to existing consts or new methods can be
|
446
|
+
created for the specific device.
|
447
|
+
|
443
448
|
## Importing GEM in AC Docker
|
444
449
|
|
445
450
|
Most of the times, the work we do in alula ruby includes just updating the model/procedures and push the changes, without having to worry about the configuration mentioned above. When we make changes to alula ruby locally we need to test if the gem file works.
|
data/VERSION.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
| Version | Date | Description |
|
4
4
|
| ------- | ------------| --------------------------------------------------------------------------- |
|
5
|
+
| v2.1.0 | 2024-10-24 | Bump multiple dependencies |
|
6
|
+
| v2.0.0 | 2024-10-17 | Add device helpers, breaking change - removed `is_` from methods returning a boolean |
|
5
7
|
| v1.10.5 | 2024-10-11 | Adding chime_info proc |
|
6
8
|
| v1.10.4 | 2024-10-07 | Adding sd_card_status to camera record, restructured sd status proc accessors |
|
7
9
|
| v1.10.3 | 2024-10-07 | Updating get_sd_status_proc to match video API's update |
|
data/alula.gemspec
CHANGED
@@ -7,7 +7,7 @@ require "alula/version"
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
8
|
spec.name = "alula-ruby"
|
9
9
|
spec.version = Alula::VERSION
|
10
|
-
spec.required_ruby_version = ">= 3.
|
10
|
+
spec.required_ruby_version = ">= 3.3.0"
|
11
11
|
spec.summary = "Ruby bindings for the Alula API"
|
12
12
|
|
13
13
|
spec.authors = ["Titus Johnson"]
|
@@ -28,12 +28,12 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_dependency 'request_store', '~> 1.0'
|
29
29
|
|
30
30
|
spec.add_development_dependency "activesupport"
|
31
|
-
spec.add_development_dependency "bundler", "~> 2.
|
31
|
+
spec.add_development_dependency "bundler", "~> 2.5"
|
32
32
|
spec.add_development_dependency "dotenv"
|
33
33
|
spec.add_development_dependency "guard-rspec"
|
34
|
-
spec.add_development_dependency "nokogiri", "~> 1.
|
35
|
-
spec.add_development_dependency "rake", "~>
|
36
|
-
spec.add_development_dependency "rspec", "~> 3.
|
37
|
-
spec.add_development_dependency "simplecov", "~> 0.
|
34
|
+
spec.add_development_dependency "nokogiri", "~> 1.16.7"
|
35
|
+
spec.add_development_dependency "rake", "~> 13.2"
|
36
|
+
spec.add_development_dependency "rspec", "~> 3.13"
|
37
|
+
spec.add_development_dependency "simplecov", "~> 0.22.0"
|
38
38
|
spec.add_development_dependency "timecop"
|
39
39
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Alula
|
4
|
+
module DeviceHelpers
|
5
|
+
#
|
6
|
+
# Relies on the implementing class having reader properties of `auto_cfg`.
|
7
|
+
# Translates it into a usable string
|
8
|
+
module AttributeTranslationsHelper
|
9
|
+
PANEL_NAME_MAP = {
|
10
|
+
0 => 'Honeywell/Vista',
|
11
|
+
1 => 'Honeywell/Vista+Passive',
|
12
|
+
2 => 'Honeywell/Lynx',
|
13
|
+
3 => 'Honeywell/Lynx+Passive',
|
14
|
+
4 => 'DSC/Depricated',
|
15
|
+
5 => 'GE-Interlogix/Caddx',
|
16
|
+
6 => 'DSC/Alexor',
|
17
|
+
7 => 'DSC/PowerSeries',
|
18
|
+
8 => 'Dialer Capture or Keyswitch',
|
19
|
+
9 => 'GE-Interlogix/Concord',
|
20
|
+
10 => '',
|
21
|
+
11 => 'Gateway',
|
22
|
+
12 => 'GE Simon XT/XTi',
|
23
|
+
13 => 'Cinch',
|
24
|
+
14 => 'Helix',
|
25
|
+
15 => 'Clare D3',
|
26
|
+
19 => 'No Panel'
|
27
|
+
}.freeze
|
28
|
+
|
29
|
+
#
|
30
|
+
# autoCfg contains multiple pieces of information depending on how you examine it.
|
31
|
+
# Doing a bitwise operation with 0xff takes the last 8 bits,
|
32
|
+
# which is the connected panel ID.
|
33
|
+
# https://ipdatatel.atlassian.net/wiki/spaces/SYS/pages/16482314/auto+cfg
|
34
|
+
def panel_name
|
35
|
+
panel_id = auto_cfg.to_i & 0xff
|
36
|
+
self.class::PANEL_NAME_MAP[panel_id] || "Unknown (#{panel_id})"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Alula
|
4
|
+
module DeviceHelpers
|
5
|
+
# Helper methods for determining the device type based on the program ID
|
6
|
+
module ProgramIdHelper
|
7
|
+
CONNECT_PROGRAM_IDS = [
|
8
|
+
211, # D3
|
9
|
+
4096, # Camera
|
10
|
+
35, # BAT-FIRE
|
11
|
+
34, # BAT-CONNECT
|
12
|
+
33, # CONNECT-XT
|
13
|
+
32, # CONNECT+
|
14
|
+
36, # CONNECT-XiP
|
15
|
+
38, # WTP-01 (is ALDER-WTP)
|
16
|
+
39, # BAT-Mini
|
17
|
+
40, # CONNECT-FLX
|
18
|
+
41, # CONNECT+PRO
|
19
|
+
42, # CONNECT+PRO-SC
|
20
|
+
43, # BAT-Mini AV
|
21
|
+
44, # WTP-02 (is ALDER-WTP_WIFI)
|
22
|
+
45, # Connect-FLX-Z
|
23
|
+
46, # Connect-FLX-DUAL
|
24
|
+
47 # Connect-FLX-DUAL-Z
|
25
|
+
].freeze
|
26
|
+
|
27
|
+
GSM_PROGRAM_IDS = [
|
28
|
+
15, 271, # IPD-BAT-CDMA
|
29
|
+
16, 272, # IPD-BAT-CDMA-WIFI
|
30
|
+
17, # IPD-BAT-CDMA-L
|
31
|
+
783, # BAT-LTE
|
32
|
+
788 # BAT-LTE-WIFI
|
33
|
+
].freeze
|
34
|
+
|
35
|
+
KAMI_CAMERA_PROGRAM_IDS = [
|
36
|
+
3072,
|
37
|
+
3073,
|
38
|
+
3074,
|
39
|
+
3075,
|
40
|
+
3076,
|
41
|
+
3090
|
42
|
+
].freeze
|
43
|
+
|
44
|
+
EUFY_CAMERA_PROGRAM_IDS = [
|
45
|
+
3086,
|
46
|
+
3087,
|
47
|
+
3088,
|
48
|
+
3089,
|
49
|
+
3091
|
50
|
+
].freeze
|
51
|
+
|
52
|
+
XIP_FAMILY_PROGRAM_IDS = [
|
53
|
+
36, # CONNECT-XiP
|
54
|
+
40, # C+Flex
|
55
|
+
41, # C+Pro
|
56
|
+
42, # C+Pro-SC
|
57
|
+
45, # C+Flex-Z
|
58
|
+
46, # C+Flex-Dual
|
59
|
+
47 # C+Flex-Dual-Z
|
60
|
+
].freeze
|
61
|
+
|
62
|
+
def connect_device?
|
63
|
+
self.class::CONNECT_PROGRAM_IDS.include?(program_id)
|
64
|
+
end
|
65
|
+
|
66
|
+
def legacy_device?
|
67
|
+
!connect_device?
|
68
|
+
end
|
69
|
+
|
70
|
+
def gsm_device?
|
71
|
+
self.class::GSM_PROGRAM_IDS.include?(program_id)
|
72
|
+
end
|
73
|
+
|
74
|
+
def connect_xt?
|
75
|
+
program_id == 33
|
76
|
+
end
|
77
|
+
|
78
|
+
def alder_wtp?
|
79
|
+
program_id == 38
|
80
|
+
end
|
81
|
+
|
82
|
+
def kami_camera?
|
83
|
+
self.class::KAMI_CAMERA_PROGRAM_IDS.include?(program_id)
|
84
|
+
end
|
85
|
+
|
86
|
+
def eufy_camera?
|
87
|
+
self.class::EUFY_CAMERA_PROGRAM_IDS.include?(program_id)
|
88
|
+
end
|
89
|
+
|
90
|
+
def connect_xip?
|
91
|
+
program_id == 36
|
92
|
+
end
|
93
|
+
|
94
|
+
def bat_mini?
|
95
|
+
[39, 43].include?(program_id)
|
96
|
+
end
|
97
|
+
|
98
|
+
def xip_family?
|
99
|
+
self.class::XIP_FAMILY_PROGRAM_IDS.include?(program_id)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Alula
|
2
4
|
class Device < Alula::RestResource
|
3
5
|
extend Alula::ResourceAttributes
|
@@ -6,8 +8,10 @@ module Alula
|
|
6
8
|
extend Alula::ApiOperations::List
|
7
9
|
extend Alula::ApiOperations::Save
|
8
10
|
|
9
|
-
include Alula::
|
11
|
+
include Alula::DeviceHelpers::AttributeTranslationsHelper
|
12
|
+
include Alula::DeviceHelpers::ProgramIdHelper
|
10
13
|
|
14
|
+
# Nested class for features_selected field
|
11
15
|
class FeaturesSelected < Alula::ObjectField
|
12
16
|
field :alarm_transmission, type: :boolean
|
13
17
|
field :alarm_notifications, type: :boolean
|
@@ -89,35 +93,35 @@ module Alula
|
|
89
93
|
sortable: false,
|
90
94
|
filterable: false,
|
91
95
|
creatable_by: [],
|
92
|
-
patchable_by: [
|
96
|
+
patchable_by: %i[system station dealer technician]
|
93
97
|
|
94
98
|
field :interactive_enabled,
|
95
99
|
type: :boolean,
|
96
100
|
sortable: false,
|
97
101
|
filterable: false,
|
98
102
|
creatable_by: [],
|
99
|
-
patchable_by: [
|
103
|
+
patchable_by: %i[system station dealer technician]
|
100
104
|
|
101
105
|
field :remote_user_logging_feature_enabled,
|
102
106
|
type: :boolean,
|
103
107
|
sortable: false,
|
104
108
|
filterable: false,
|
105
109
|
creatable_by: [],
|
106
|
-
patchable_by: [
|
110
|
+
patchable_by: %i[system station dealer technician]
|
107
111
|
|
108
112
|
field :push_notification_enabled,
|
109
113
|
type: :boolean,
|
110
114
|
sortable: false,
|
111
115
|
filterable: false,
|
112
116
|
creatable_by: [],
|
113
|
-
patchable_by: [
|
117
|
+
patchable_by: %i[system station dealer technician]
|
114
118
|
|
115
119
|
field :user_sync_disabled,
|
116
120
|
type: :boolean,
|
117
121
|
sortable: false,
|
118
122
|
filterable: false,
|
119
123
|
creatable_by: [],
|
120
|
-
patchable_by: [
|
124
|
+
patchable_by: %i[system station dealer technician]
|
121
125
|
|
122
126
|
field :auto_cfg,
|
123
127
|
type: :string,
|
@@ -180,7 +184,7 @@ module Alula
|
|
180
184
|
sortable: false,
|
181
185
|
filterable: false,
|
182
186
|
creatable_by: [],
|
183
|
-
patchable_by: [
|
187
|
+
patchable_by: %i[system station dealer technician user]
|
184
188
|
|
185
189
|
field :online_status,
|
186
190
|
type: :string,
|
@@ -229,63 +233,63 @@ module Alula
|
|
229
233
|
sortable: true,
|
230
234
|
filterable: true,
|
231
235
|
creatable_by: [],
|
232
|
-
patchable_by: [
|
236
|
+
patchable_by: %i[system station dealer technician user]
|
233
237
|
|
234
238
|
field :station_phone_number,
|
235
239
|
type: :string,
|
236
240
|
sortable: false,
|
237
241
|
filterable: false,
|
238
242
|
creatable_by: [],
|
239
|
-
patchable_by: [
|
243
|
+
patchable_by: %i[system station dealer technician]
|
240
244
|
|
241
245
|
field :station_account_number,
|
242
246
|
type: :string,
|
243
247
|
sortable: false,
|
244
248
|
filterable: true,
|
245
249
|
creatable_by: [],
|
246
|
-
patchable_by: [
|
250
|
+
patchable_by: %i[system station dealer technician]
|
247
251
|
|
248
252
|
field :station_aux_number,
|
249
253
|
type: :string,
|
250
254
|
sortable: false,
|
251
255
|
filterable: false,
|
252
256
|
creatable_by: [],
|
253
|
-
patchable_by: [
|
257
|
+
patchable_by: %i[system station dealer technician]
|
254
258
|
|
255
259
|
field :override_account_number,
|
256
260
|
type: :boolean,
|
257
261
|
sortable: false,
|
258
262
|
filterable: false,
|
259
263
|
creatable_by: [],
|
260
|
-
patchable_by: [
|
264
|
+
patchable_by: %i[system station dealer technician]
|
261
265
|
|
262
266
|
field :signal_suppress_open_close,
|
263
267
|
type: :boolean,
|
264
268
|
sortable: false,
|
265
269
|
filterable: false,
|
266
270
|
creatable_by: [],
|
267
|
-
patchable_by: [
|
271
|
+
patchable_by: %i[system station dealer technician]
|
268
272
|
|
269
273
|
field :signal_suppress_bypass,
|
270
274
|
type: :boolean,
|
271
275
|
sortable: false,
|
272
276
|
filterable: false,
|
273
277
|
creatable_by: [],
|
274
|
-
patchable_by: [
|
278
|
+
patchable_by: %i[system station dealer technician]
|
275
279
|
|
276
280
|
field :open_close_suppression,
|
277
281
|
type: :boolean,
|
278
282
|
sortable: false,
|
279
283
|
filterable: false,
|
280
284
|
creatable_by: [],
|
281
|
-
patchable_by: [
|
285
|
+
patchable_by: %i[system station dealer technician]
|
282
286
|
|
283
287
|
field :convert_sia_to_contact_id,
|
284
288
|
type: :boolean,
|
285
289
|
sortable: false,
|
286
290
|
filterable: false,
|
287
291
|
creatable_by: [],
|
288
|
-
patchable_by: [
|
292
|
+
patchable_by: %i[system station dealer technician]
|
289
293
|
|
290
294
|
field :downloader_phone_number,
|
291
295
|
type: :string,
|
@@ -299,112 +303,112 @@ module Alula
|
|
299
303
|
sortable: false,
|
300
304
|
filterable: true,
|
301
305
|
creatable_by: [],
|
302
|
-
patchable_by: [
|
306
|
+
patchable_by: %i[system station dealer technician]
|
303
307
|
|
304
308
|
field :network_trouble_timeout,
|
305
309
|
type: :string,
|
306
310
|
sortable: false,
|
307
311
|
filterable: false,
|
308
312
|
creatable_by: [],
|
309
|
-
patchable_by: [
|
313
|
+
patchable_by: %i[system station dealer technician]
|
310
314
|
|
311
315
|
field :physical_address1,
|
312
316
|
type: :string,
|
313
317
|
sortable: false,
|
314
318
|
filterable: true,
|
315
319
|
creatable_by: [],
|
316
|
-
patchable_by: [
|
320
|
+
patchable_by: %i[system station dealer technician user]
|
317
321
|
|
318
322
|
field :physical_address2,
|
319
323
|
type: :string,
|
320
324
|
sortable: false,
|
321
325
|
filterable: true,
|
322
326
|
creatable_by: [],
|
323
|
-
patchable_by: [
|
327
|
+
patchable_by: %i[system station dealer technician user]
|
324
328
|
|
325
329
|
field :physical_street_number,
|
326
330
|
type: :string,
|
327
331
|
sortable: false,
|
328
332
|
filterable: true,
|
329
333
|
creatable_by: [],
|
330
|
-
patchable_by: [
|
334
|
+
patchable_by: %i[system station dealer technician user]
|
331
335
|
|
332
336
|
field :physical_street_name,
|
333
337
|
type: :string,
|
334
338
|
sortable: false,
|
335
339
|
filterable: true,
|
336
340
|
creatable_by: [],
|
337
|
-
patchable_by: [
|
341
|
+
patchable_by: %i[system station dealer technician user]
|
338
342
|
|
339
343
|
field :physical_street_direction,
|
340
344
|
type: :string,
|
341
345
|
sortable: false,
|
342
346
|
filterable: true,
|
343
347
|
creatable_by: [],
|
344
|
-
patchable_by: [
|
348
|
+
patchable_by: %i[system station dealer technician user]
|
345
349
|
|
346
350
|
field :physical_city,
|
347
351
|
type: :string,
|
348
352
|
sortable: false,
|
349
353
|
filterable: true,
|
350
354
|
creatable_by: [],
|
351
|
-
patchable_by: [
|
355
|
+
patchable_by: %i[system station dealer technician user]
|
352
356
|
|
353
357
|
field :physical_state,
|
354
358
|
type: :string,
|
355
359
|
sortable: false,
|
356
360
|
filterable: true,
|
357
361
|
creatable_by: [],
|
358
|
-
patchable_by: [
|
362
|
+
patchable_by: %i[system station dealer technician user]
|
359
363
|
|
360
364
|
field :physical_zip,
|
361
365
|
type: :string,
|
362
366
|
sortable: false,
|
363
367
|
filterable: true,
|
364
368
|
creatable_by: [],
|
365
|
-
patchable_by: [
|
369
|
+
patchable_by: %i[system station dealer technician user]
|
366
370
|
|
367
371
|
field :physical_site_number,
|
368
372
|
type: :string,
|
369
373
|
sortable: false,
|
370
374
|
filterable: true,
|
371
375
|
creatable_by: [],
|
372
|
-
patchable_by: [
|
376
|
+
patchable_by: %i[system station dealer technician user]
|
373
377
|
|
374
378
|
field :physical_suite,
|
375
379
|
type: :string,
|
376
380
|
sortable: false,
|
377
381
|
filterable: true,
|
378
382
|
creatable_by: [],
|
379
|
-
patchable_by: [
|
383
|
+
patchable_by: %i[system station dealer technician user]
|
380
384
|
|
381
385
|
field :physical_floor,
|
382
386
|
type: :string,
|
383
387
|
sortable: false,
|
384
388
|
filterable: true,
|
385
389
|
creatable_by: [],
|
386
|
-
patchable_by: [
|
390
|
+
patchable_by: %i[system station dealer technician user]
|
387
391
|
|
388
392
|
field :physical_description,
|
389
393
|
type: :string,
|
390
394
|
sortable: false,
|
391
395
|
filterable: true,
|
392
396
|
creatable_by: [],
|
393
|
-
patchable_by: [
|
397
|
+
patchable_by: %i[system station dealer technician user]
|
394
398
|
|
395
399
|
field :two_way_voice_enabled,
|
396
400
|
type: :boolean,
|
397
401
|
sortable: false,
|
398
402
|
filterable: false,
|
399
403
|
creatable_by: [],
|
400
|
-
patchable_by: [
|
404
|
+
patchable_by: %i[system station dealer technician]
|
401
405
|
|
402
406
|
field :sia_two_way_voice_enabled,
|
403
407
|
type: :boolean,
|
404
408
|
sortable: false,
|
405
409
|
filterable: false,
|
406
410
|
creatable_by: [],
|
407
|
-
patchable_by: [
|
411
|
+
patchable_by: %i[system station dealer technician]
|
408
412
|
|
409
413
|
field :date_deactivated,
|
410
414
|
type: :date,
|
@@ -454,7 +458,7 @@ module Alula
|
|
454
458
|
sortable: false,
|
455
459
|
filterable: true,
|
456
460
|
creatable_by: [],
|
457
|
-
patchable_by: [
|
461
|
+
patchable_by: %i[system station dealer technician],
|
458
462
|
use: FeaturesSelected
|
459
463
|
|
460
464
|
field :any_trouble,
|
@@ -90,11 +90,11 @@ module Alula
|
|
90
90
|
patchable_by: %i[system station dealer user],
|
91
91
|
creatable_by: %i[system station dealer user]
|
92
92
|
|
93
|
-
def
|
93
|
+
def jsw?
|
94
94
|
manufacturer == 'jsw'
|
95
95
|
end
|
96
96
|
|
97
|
-
def
|
97
|
+
def hik?
|
98
98
|
manufacturer == 'hikvision'
|
99
99
|
end
|
100
100
|
end
|
data/lib/alula/version.rb
CHANGED
data/lib/alula.rb
CHANGED
@@ -24,7 +24,8 @@ require_relative 'alula/client_configuration'
|
|
24
24
|
require_relative 'alula/errors'
|
25
25
|
require_relative 'alula/list_object'
|
26
26
|
require_relative 'alula/oauth'
|
27
|
-
require_relative 'alula/helpers/
|
27
|
+
require_relative 'alula/helpers/device_helpers/attribute_translations_helper'
|
28
|
+
require_relative 'alula/helpers/device_helpers/program_id_helper'
|
28
29
|
require_relative 'alula/resources/billing_program'
|
29
30
|
require_relative 'alula/resources/device'
|
30
31
|
require_relative 'alula/resources/device_charge'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alula-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Titus Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '2.
|
61
|
+
version: '2.5'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '2.
|
68
|
+
version: '2.5'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: dotenv
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,56 +100,56 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.
|
103
|
+
version: 1.16.7
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 1.
|
110
|
+
version: 1.16.7
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rake
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '13.2'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '13.2'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rspec
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '3.
|
131
|
+
version: '3.13'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '3.
|
138
|
+
version: '3.13'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: simplecov
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.
|
145
|
+
version: 0.22.0
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
152
|
+
version: 0.22.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: timecop
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,7 +209,8 @@ files:
|
|
209
209
|
- lib/alula/client_configuration.rb
|
210
210
|
- lib/alula/errors.rb
|
211
211
|
- lib/alula/filter_builder.rb
|
212
|
-
- lib/alula/helpers/
|
212
|
+
- lib/alula/helpers/device_helpers/attribute_translations_helper.rb
|
213
|
+
- lib/alula/helpers/device_helpers/program_id_helper.rb
|
213
214
|
- lib/alula/helpers/jwt_helper.rb
|
214
215
|
- lib/alula/list_object.rb
|
215
216
|
- lib/alula/meta.rb
|
@@ -317,7 +318,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
317
318
|
requirements:
|
318
319
|
- - ">="
|
319
320
|
- !ruby/object:Gem::Version
|
320
|
-
version: 3.
|
321
|
+
version: 3.3.0
|
321
322
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
322
323
|
requirements:
|
323
324
|
- - ">="
|
@@ -1,68 +0,0 @@
|
|
1
|
-
module Alula
|
2
|
-
|
3
|
-
#
|
4
|
-
# Relies on the implementing class having reader properties of `program_id`
|
5
|
-
# and `auto_cfg`. Translates those values into usable strings
|
6
|
-
module DeviceAttributeTranslations
|
7
|
-
PROGRAM_ID_MAP = {
|
8
|
-
32 => 'CONNECT+',
|
9
|
-
35 => 'BAT-FIRE',
|
10
|
-
34 => 'BAT-CONNECT',
|
11
|
-
211 => 'CLARE-D3',
|
12
|
-
4096 => 'CAMERA',
|
13
|
-
783 => 'BAT-LTE',
|
14
|
-
0 => 'IPD-BAT',
|
15
|
-
1 => 'IPD-BAT',
|
16
|
-
2 => 'IPD-BAT',
|
17
|
-
3 => 'IPD-BAT-ZKI',
|
18
|
-
4 => 'IPD-BAT',
|
19
|
-
8 => 'IPD-BAT',
|
20
|
-
6 => 'IPD-ZGW',
|
21
|
-
9 => 'IPD-BAT-U',
|
22
|
-
11 => 'IPD-ZGW',
|
23
|
-
15 => 'IPD-BAT-CDMA',
|
24
|
-
16 => 'IPD-BAT-WIFI',
|
25
|
-
17 => 'IPD-BAT-CDMA-L',
|
26
|
-
18 => 'IPD-MPWC',
|
27
|
-
19 => 'IPD-CAT-CDMA',
|
28
|
-
20 => 'IPD-BAT-CDMA-WIFI',
|
29
|
-
22 => 'IPD-CAT-XT',
|
30
|
-
33 => 'IGM',
|
31
|
-
271 => 'IPD-BAT-CDMA1'
|
32
|
-
}.freeze
|
33
|
-
|
34
|
-
PANEL_NAME_MAP = {
|
35
|
-
0 => 'Honeywell/Vista',
|
36
|
-
1 => 'Honeywell/Vista+Passive',
|
37
|
-
2 => 'Honeywell/Lynx',
|
38
|
-
3 => 'Honeywell/Lynx+Passive',
|
39
|
-
4 => 'DSC/Depricated',
|
40
|
-
5 => 'GE-Interlogix/Caddx',
|
41
|
-
6 => 'DSC/Alexor',
|
42
|
-
7 => 'DSC/PowerSeries',
|
43
|
-
8 => 'Dialer Capture or Keyswitch',
|
44
|
-
9 => 'GE-Interlogix/Concord',
|
45
|
-
10 => '',
|
46
|
-
11 => 'Gateway',
|
47
|
-
12 => 'GE Simon XT/XTi',
|
48
|
-
13 => 'Cinch',
|
49
|
-
14 => 'Helix',
|
50
|
-
15 => 'Clare D3',
|
51
|
-
19 => 'No Panel',
|
52
|
-
}.freeze
|
53
|
-
|
54
|
-
def device_name
|
55
|
-
self.class::PROGRAM_ID_MAP[self.program_id] || "Unknown (#{self.program_id})"
|
56
|
-
end
|
57
|
-
|
58
|
-
#
|
59
|
-
# autoCfg contains multiple pieces of information depending on how you examine it.
|
60
|
-
# Doing a bitwise operation with 0xff takes the last 8 bits,
|
61
|
-
# which is the connected panel ID.
|
62
|
-
# https://ipdatatel.atlassian.net/wiki/spaces/SYS/pages/16482314/auto+cfg
|
63
|
-
def panel_name
|
64
|
-
panel_id = auto_cfg.to_i & 0xff
|
65
|
-
self.class::PANEL_NAME_MAP[panel_id] || "Unknown (#{panel_id})"
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|