homebridge-securitysystem 7.1.0 → 7.2.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/.github/workflows/{npm-publish-package.yml → publish-package.yml} +1 -1
- package/.github/workflows/stale.yml +1 -1
- package/.github/workflows/update-version.yml +50 -0
- package/package.json +1 -1
- package/src/index.js +8 -0
- package/src/utils/options.js +5 -0
- package/.github/workflows/npm-publish-github-packages.yml +0 -36
|
@@ -17,7 +17,7 @@ jobs:
|
|
|
17
17
|
pull-requests: write
|
|
18
18
|
|
|
19
19
|
steps:
|
|
20
|
-
- uses: actions/stale@
|
|
20
|
+
- uses: actions/stale@v8
|
|
21
21
|
with:
|
|
22
22
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
23
23
|
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a few days if no further activity occurs. Thank you for your contributions.'
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Update version
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
channel:
|
|
7
|
+
type: choice
|
|
8
|
+
default: stable
|
|
9
|
+
description: Pick channel
|
|
10
|
+
options:
|
|
11
|
+
- alpha
|
|
12
|
+
- beta
|
|
13
|
+
- stable
|
|
14
|
+
|
|
15
|
+
new-build-for-prerelease:
|
|
16
|
+
type: boolean
|
|
17
|
+
default: true
|
|
18
|
+
description: New build for prerelease
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
update-version:
|
|
22
|
+
name: Update version name
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
permissions:
|
|
25
|
+
contents: write
|
|
26
|
+
pull-requests: write
|
|
27
|
+
|
|
28
|
+
steps:
|
|
29
|
+
- name: Checkout branch
|
|
30
|
+
uses: actions/checkout@v3
|
|
31
|
+
|
|
32
|
+
- name: Generate tag name
|
|
33
|
+
uses: MiguelRipoll23/generate-tag-name@v1.0.0
|
|
34
|
+
id: generate-tag-name
|
|
35
|
+
with:
|
|
36
|
+
channel: ${{ inputs.channel }}
|
|
37
|
+
|
|
38
|
+
- name: Update version name
|
|
39
|
+
uses: reedyuk/npm-version@1.1.1
|
|
40
|
+
with:
|
|
41
|
+
version: ${{ steps.generate-tag-name.outputs.tag-name }}
|
|
42
|
+
|
|
43
|
+
- name: Create pull request
|
|
44
|
+
uses: peter-evans/create-pull-request@v4
|
|
45
|
+
with:
|
|
46
|
+
branch: version/${{ steps.generate-tag-name.outputs.tag-name }}
|
|
47
|
+
commit-message: ${{ steps.generate-tag-name.outputs.tag-name }}
|
|
48
|
+
title: Bump version to ${{ steps.generate-tag-name.outputs.tag-name }}
|
|
49
|
+
body: Automated pull request triggered by a new version update.
|
|
50
|
+
labels: ignore-for-release
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-securitysystem",
|
|
3
3
|
"displayName": "Homebridge Security System",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.2.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
|
@@ -154,6 +154,8 @@ function SecuritySystem(log, config) {
|
|
|
154
154
|
.on("get", this.getTargetState.bind(this))
|
|
155
155
|
.on("set", this.setTargetState.bind(this));
|
|
156
156
|
|
|
157
|
+
this.log.info("Security system service (" + options.securitySystemName + ")");
|
|
158
|
+
|
|
157
159
|
this.service.getCharacteristic(
|
|
158
160
|
Characteristic.SecuritySystemCurrentState
|
|
159
161
|
).value = this.currentState;
|
|
@@ -1028,6 +1030,9 @@ SecuritySystem.prototype.updateTargetState = function (
|
|
|
1028
1030
|
|
|
1029
1031
|
// Play sound
|
|
1030
1032
|
this.playAudio("target", state);
|
|
1033
|
+
|
|
1034
|
+
// Log
|
|
1035
|
+
this.log.info("Arm delay (" + armSeconds + " second/s)");
|
|
1031
1036
|
}
|
|
1032
1037
|
}
|
|
1033
1038
|
|
|
@@ -1234,6 +1239,9 @@ SecuritySystem.prototype.updateTripSwitch = function (
|
|
|
1234
1239
|
triggerSeconds = options.nightTriggerSeconds;
|
|
1235
1240
|
}
|
|
1236
1241
|
|
|
1242
|
+
// Log
|
|
1243
|
+
this.log.debug("Trigger delay (" + triggerSeconds + " second/s)");
|
|
1244
|
+
|
|
1237
1245
|
this.triggerTimeout = setTimeout(() => {
|
|
1238
1246
|
this.triggerTimeout = null;
|
|
1239
1247
|
this.setCurrentState(
|
package/src/utils/options.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
const options = {
|
|
2
2
|
init: (log, config) => {
|
|
3
|
+
// Log
|
|
4
|
+
log.info("Config", JSON.stringify(config));
|
|
5
|
+
|
|
3
6
|
options.checkDeprecated(log, config);
|
|
4
7
|
|
|
5
8
|
options.name = config.name;
|
|
@@ -117,6 +120,8 @@ const options = {
|
|
|
117
120
|
options.setDefaultValues();
|
|
118
121
|
options.validateValues(log);
|
|
119
122
|
options.normalizeValues();
|
|
123
|
+
|
|
124
|
+
log.info("Options", JSON.stringify(options));
|
|
120
125
|
},
|
|
121
126
|
|
|
122
127
|
isValueSet: (value) => {
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
-
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
|
3
|
-
|
|
4
|
-
name: Publish package (GitHub)
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
release:
|
|
8
|
-
types: [created]
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
build:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v3
|
|
15
|
-
- uses: actions/setup-node@v3
|
|
16
|
-
with:
|
|
17
|
-
node-version: 16
|
|
18
|
-
- run: npm ci
|
|
19
|
-
- run: npm test
|
|
20
|
-
|
|
21
|
-
publish-gpr:
|
|
22
|
-
needs: build
|
|
23
|
-
runs-on: ubuntu-latest
|
|
24
|
-
permissions:
|
|
25
|
-
contents: read
|
|
26
|
-
packages: write
|
|
27
|
-
steps:
|
|
28
|
-
- uses: actions/checkout@v3
|
|
29
|
-
- uses: actions/setup-node@v3
|
|
30
|
-
with:
|
|
31
|
-
node-version: 16
|
|
32
|
-
registry-url: https://npm.pkg.github.com/
|
|
33
|
-
- run: npm ci
|
|
34
|
-
- run: npm publish
|
|
35
|
-
env:
|
|
36
|
-
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|