homebridge-securitysystem 6.4.0 → 6.5.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.
- package/.eslintrc.js +14 -288
- package/config.schema.json +33 -2
- package/package.json +1 -1
- package/src/index.js +782 -427
- package/src/utils/options.js +9 -8
package/src/utils/options.js
CHANGED
|
@@ -75,6 +75,7 @@ const options = {
|
|
|
75
75
|
options.audioVolume = config.audio_volume;
|
|
76
76
|
options.audioArmingLooped = config.audio_arming_looped;
|
|
77
77
|
options.audioAlertLooped = config.audio_alert_looped;
|
|
78
|
+
options.audioExtraVariables = config.audio_extra_variables;
|
|
78
79
|
|
|
79
80
|
// Commands
|
|
80
81
|
options.commandTargetHome = config.command_target_home;
|
|
@@ -112,7 +113,7 @@ const options = {
|
|
|
112
113
|
isValueSet: (value) => {
|
|
113
114
|
if (value === undefined || value === null) {
|
|
114
115
|
// Check empty strings
|
|
115
|
-
if (typeof value ===
|
|
116
|
+
if (typeof value === "string" && value.trim() === "") {
|
|
116
117
|
return false;
|
|
117
118
|
}
|
|
118
119
|
|
|
@@ -128,11 +129,11 @@ const options = {
|
|
|
128
129
|
|
|
129
130
|
setDefaultValues: () => {
|
|
130
131
|
if (options.isValueSet(options.name) === false) {
|
|
131
|
-
options.name =
|
|
132
|
+
options.name = "Security System";
|
|
132
133
|
}
|
|
133
134
|
|
|
134
135
|
if (options.isValueSet(options.defaultMode) === false) {
|
|
135
|
-
options.defaultMode =
|
|
136
|
+
options.defaultMode = "off";
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
if (options.isValueSet(options.disabledModes) === false) {
|
|
@@ -251,7 +252,7 @@ const options = {
|
|
|
251
252
|
}
|
|
252
253
|
|
|
253
254
|
if (options.isValueSet(options.doubleKnockModes) === false) {
|
|
254
|
-
options.doubleKnockModes = [
|
|
255
|
+
options.doubleKnockModes = ["Away"];
|
|
255
256
|
}
|
|
256
257
|
|
|
257
258
|
// Audio
|
|
@@ -260,7 +261,7 @@ const options = {
|
|
|
260
261
|
}
|
|
261
262
|
|
|
262
263
|
if (options.isValueSet(options.audioLanguage) === false) {
|
|
263
|
-
options.audioLanguage =
|
|
264
|
+
options.audioLanguage = "en-US";
|
|
264
265
|
}
|
|
265
266
|
|
|
266
267
|
if (options.isValueSet(options.audioArmingLooped) === false) {
|
|
@@ -279,12 +280,12 @@ const options = {
|
|
|
279
280
|
|
|
280
281
|
validateValues: (log) => {
|
|
281
282
|
if (options.resetMinutes === 0) {
|
|
282
|
-
log.error(
|
|
283
|
+
log.error("Value of setting 'Reset Delay Seconds' should be at least 1.");
|
|
283
284
|
options.resetMinutes = 1;
|
|
284
285
|
}
|
|
285
286
|
|
|
286
287
|
if (options.serverPort < 0 || options.serverPort > 65535) {
|
|
287
|
-
log.error(
|
|
288
|
+
log.error("Value of setting 'Server Port' not between 0 and 65535.");
|
|
288
289
|
}
|
|
289
290
|
},
|
|
290
291
|
|
|
@@ -295,7 +296,7 @@ const options = {
|
|
|
295
296
|
options.webhookTriggered = null;
|
|
296
297
|
options.commandTriggered = null;
|
|
297
298
|
}
|
|
298
|
-
}
|
|
299
|
+
},
|
|
299
300
|
};
|
|
300
301
|
|
|
301
302
|
module.exports = options;
|