homebridge-securitysystem 6.3.0 → 6.3.2-beta.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/README.md +15 -9
- package/config.schema.json +0 -8
- package/package.json +1 -1
- package/src/index.js +3 -11
- package/src/utils/options.js +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# homebridge-securitysystem
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/homebridge-securitysystem)
|
|
3
4
|
[](https://www.npmjs.com/package/homebridge-securitysystem)
|
|
4
5
|
[](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
|
|
5
6
|
|
|
@@ -8,11 +9,13 @@ Homebridge plugin that creates a security system accessory that can be triggered
|
|
|
8
9
|
[❤️ One-time donation](https://paypal.me/miguelripoll23)
|
|
9
10
|
|
|
10
11
|
## Installation
|
|
12
|
+
|
|
11
13
|
If you already have [Homebridge](https://github.com/homebridge/homebridge) installed, execute the following command:
|
|
12
14
|
|
|
13
15
|
`npm i -g --unsafe-perm homebridge-securitysystem`
|
|
14
16
|
|
|
15
17
|
## Demo
|
|
18
|
+
|
|
16
19
|
<div align="left">
|
|
17
20
|
<img align="right" width="206" height="445" src="https://media4.giphy.com/media/wDhRHFfrLRDeC1sXG5/giphy.gif">
|
|
18
21
|
<p>Want to know how it looks like? It's pretty customizable, you can configure it to show as many switches as you like.</p>
|
|
@@ -23,22 +26,25 @@ If you already have [Homebridge](https://github.com/homebridge/homebridge) insta
|
|
|
23
26
|
</div>
|
|
24
27
|
|
|
25
28
|
## Automations
|
|
26
|
-
|
|
29
|
+
|
|
30
|
+
Using the `Home` app is recommended for regular users, for more advanced users the `Eve` or a similar app will let you make use of the custom options that the security system itself exposes.
|
|
27
31
|
|
|
28
32
|
Here are some examples of automations that can be created:
|
|
29
33
|
|
|
30
|
-
| Trigger
|
|
31
|
-
|
|
32
|
-
| Motion is Detected
|
|
33
|
-
| Door is Opened
|
|
34
|
-
| NFC Tag is Detected (1)
|
|
35
|
-
| Security System Triggers
|
|
34
|
+
| Trigger | Actions |
|
|
35
|
+
| ------------------------ | ----------------------------- |
|
|
36
|
+
| Motion is Detected | Turn on `Siren Night` |
|
|
37
|
+
| Door is Opened | Turn on `Siren Away` |
|
|
38
|
+
| NFC Tag is Detected (1) | Set Security system to `Home` |
|
|
39
|
+
| Security System Triggers | Play Audio (2) |
|
|
36
40
|
|
|
37
41
|
(1) Shortcuts app is required to create this automation.
|
|
38
42
|
|
|
39
43
|
(2) AirPlay 2 speaker and Apple Music subscription are required.
|
|
40
44
|
|
|
41
|
-
**
|
|
45
|
+
> **Warning**
|
|
46
|
+
> Use an NFC tag to arm/disarm the security system easily and securely without using the `Home` app.
|
|
42
47
|
|
|
43
48
|
## Contributions
|
|
49
|
+
|
|
44
50
|
Pull requests are welcome.
|
package/config.schema.json
CHANGED
|
@@ -333,13 +333,6 @@
|
|
|
333
333
|
"de-DE"
|
|
334
334
|
]
|
|
335
335
|
},
|
|
336
|
-
"audio_configuration": {
|
|
337
|
-
"title": "Audio Configuration",
|
|
338
|
-
"type": "string",
|
|
339
|
-
"required": false,
|
|
340
|
-
"default": "SDL_AUDIODRIVER=\"alsa\" AUDIODEV=\"hw:0,0\"",
|
|
341
|
-
"placeholder": "SDL_AUDIODRIVER=\"alsa\" AUDIODEV=\"hw:0,0\""
|
|
342
|
-
},
|
|
343
336
|
"audio_path": {
|
|
344
337
|
"title": "Custom Audio Path",
|
|
345
338
|
"description": "Instructions will be created in this path.",
|
|
@@ -660,7 +653,6 @@
|
|
|
660
653
|
"audio_language"
|
|
661
654
|
]
|
|
662
655
|
},
|
|
663
|
-
"audio_configuration",
|
|
664
656
|
{
|
|
665
657
|
"type": "div",
|
|
666
658
|
"displayFlex": true,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-securitysystem",
|
|
3
3
|
"displayName": "Homebridge Security System",
|
|
4
|
-
"version": "6.3.0",
|
|
4
|
+
"version": "6.3.2-beta.0",
|
|
5
5
|
"description": "Homebridge plugin that creates a security system accessory that can be triggered by HomeKit sensors.",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"scripts": {
|
package/src/index.js
CHANGED
|
@@ -1304,19 +1304,11 @@ SecuritySystem.prototype.playAudio = async function (type, state) {
|
|
|
1304
1304
|
}
|
|
1305
1305
|
|
|
1306
1306
|
// Process
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
if (options.isValueSet(options.audioConfiguration)) {
|
|
1310
|
-
command += `${options.audioConfiguration} `;
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
|
-
command += `ffplay ${commandArguments.join(' ')}`;
|
|
1314
|
-
|
|
1315
|
-
this.audioProcess = spawn(command, { shell: true });
|
|
1316
|
-
this.log.debug(command);
|
|
1307
|
+
this.audioProcess = spawn('ffplay', commandArguments);
|
|
1308
|
+
this.log.debug(`ffplay ${commandArguments.join(' ')}`);
|
|
1317
1309
|
|
|
1318
1310
|
this.audioProcess.on('error', data => {
|
|
1319
|
-
// Check if
|
|
1311
|
+
// Check if command is missing
|
|
1320
1312
|
if (data !== null && data.toString().indexOf('ENOENT') > -1) {
|
|
1321
1313
|
this.log.error('Unable to play sound, ffmpeg is not installed.');
|
|
1322
1314
|
return;
|
package/src/utils/options.js
CHANGED
|
@@ -70,7 +70,6 @@ const options = {
|
|
|
70
70
|
|
|
71
71
|
// Audio
|
|
72
72
|
options.audio = config.audio;
|
|
73
|
-
options.audioConfiguration = config.audio_configuration;
|
|
74
73
|
options.audioPath = config.audio_path;
|
|
75
74
|
options.audioLanguage = config.audio_language;
|
|
76
75
|
options.audioVolume = config.audio_volume;
|