homebridge-alexa 0.9.2 → 0.9.3-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/.github/dependabot.yml
CHANGED
|
@@ -6,7 +6,42 @@ updates:
|
|
|
6
6
|
interval: daily
|
|
7
7
|
time: "10:00"
|
|
8
8
|
open-pull-requests-limit: 10
|
|
9
|
-
reviewers:
|
|
10
|
-
- NorthernMan54
|
|
11
9
|
assignees:
|
|
12
10
|
- NorthernMan54
|
|
11
|
+
labels:
|
|
12
|
+
- "dependencies"
|
|
13
|
+
# Group related updates together (optional)
|
|
14
|
+
groups:
|
|
15
|
+
packages:
|
|
16
|
+
patterns:
|
|
17
|
+
- "*"
|
|
18
|
+
# Automatically rebase PRs when conflicts occur
|
|
19
|
+
rebase-strategy: "auto"
|
|
20
|
+
# Commit message prefix
|
|
21
|
+
commit-message:
|
|
22
|
+
prefix: "chore"
|
|
23
|
+
prefix-development: "chore"
|
|
24
|
+
include: "scope"
|
|
25
|
+
|
|
26
|
+
- package-ecosystem: "github-actions"
|
|
27
|
+
directory: "/"
|
|
28
|
+
schedule:
|
|
29
|
+
interval: "daily"
|
|
30
|
+
time: "09:00"
|
|
31
|
+
# Create PRs for out-of-date actions
|
|
32
|
+
open-pull-requests-limit: 10
|
|
33
|
+
# Add labels to PRs
|
|
34
|
+
labels:
|
|
35
|
+
- "dependencies"
|
|
36
|
+
# Group related updates together (optional)
|
|
37
|
+
groups:
|
|
38
|
+
actions:
|
|
39
|
+
patterns:
|
|
40
|
+
- "*"
|
|
41
|
+
# Automatically rebase PRs when conflicts occur
|
|
42
|
+
rebase-strategy: "auto"
|
|
43
|
+
# Commit message prefix
|
|
44
|
+
commit-message:
|
|
45
|
+
prefix: "chore"
|
|
46
|
+
prefix-development: "chore"
|
|
47
|
+
include: "scope"
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#!/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This scripts queries the npm registry to pull out the latest version for a given tag.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const assert = require('node:assert')
|
|
8
|
+
const child_process = require('node:child_process')
|
|
9
|
+
const fs = require('node:fs')
|
|
10
|
+
const process = require('node:process')
|
|
11
|
+
|
|
12
|
+
const BRANCH_VERSION_PATTERN = /^([A-Z]+)-(\d+\.\d+\.\d+)$/i
|
|
13
|
+
|
|
14
|
+
// Load the contents of the package.json file
|
|
15
|
+
const packageJSON = JSON.parse(fs.readFileSync('package.json', 'utf8'))
|
|
16
|
+
|
|
17
|
+
const refArgument = process.argv[2]
|
|
18
|
+
const tagArgument = process.argv[3] || 'latest'
|
|
19
|
+
|
|
20
|
+
if (!refArgument) {
|
|
21
|
+
console.error('ref argument is missing')
|
|
22
|
+
console.error('Usage: npm-version-script.js <ref> [tag]')
|
|
23
|
+
process.exit(1)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Queries the NPM registry for the latest version for the provided base version and tag.
|
|
28
|
+
* If the tag is latest, then the base version is returned if it exists. For other tags, the latest
|
|
29
|
+
* version found for that base version and tag is returned.
|
|
30
|
+
* @param baseVersion The base version to query for, e.g. 2.0.0
|
|
31
|
+
* @param tag The tag to query for, e.g. beta or latest
|
|
32
|
+
* @returns {string} Returns the version, or '' if not found
|
|
33
|
+
*/
|
|
34
|
+
function getTagVersionFromNpm(baseVersion, tag) {
|
|
35
|
+
try {
|
|
36
|
+
return JSON.parse(child_process.execSync(`npm info ${packageJSON.name} versions --json`).toString('utf8').trim())
|
|
37
|
+
.filter(v => tag === 'latest' ? v === baseVersion : v.startsWith(`${baseVersion}-${tag}.`)) // find all published versions for this base version and tag
|
|
38
|
+
.reduce((_, current) => current, '') // choose the last as they're sorted in ascending order, or '' if there are none
|
|
39
|
+
} catch (e) {
|
|
40
|
+
console.error(`Failed to query the npm registry for the latest version for tag: ${tag}`, e)
|
|
41
|
+
// throw e;
|
|
42
|
+
return ''
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function desiredTargetVersion(ref) {
|
|
47
|
+
// ref is a GitHub action ref string
|
|
48
|
+
if (ref.startsWith('refs/pull/')) {
|
|
49
|
+
throw new Error('The version script was executed inside a PR!')
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
assert(ref.startsWith('refs/heads/'))
|
|
53
|
+
const branchName = ref.slice('refs/heads/'.length)
|
|
54
|
+
|
|
55
|
+
const results = branchName.match(BRANCH_VERSION_PATTERN)
|
|
56
|
+
if (results !== null) {
|
|
57
|
+
if (results[1] !== tagArgument) {
|
|
58
|
+
console.warn(`The base branch name (${results[1]}) differs from the tag name ${tagArgument}`)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return results[2]
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
throw new Error(`Malformed branch name for ref: ${ref}. Can't derive the base version. Use a branch name like: beta-x.x.x or alpha-x.x.x`)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// derive the base version from the branch ref
|
|
68
|
+
const baseVersion = desiredTargetVersion(refArgument)
|
|
69
|
+
|
|
70
|
+
// query the npm registry for the latest version of the provided tag name
|
|
71
|
+
const latestReleasedVersion = getTagVersionFromNpm(baseVersion, tagArgument) // e.g. 0.7.0-beta.12
|
|
72
|
+
|
|
73
|
+
let publishTag
|
|
74
|
+
|
|
75
|
+
if (latestReleasedVersion) {
|
|
76
|
+
console.warn(`Latest published version for ${baseVersion} with tag ${tagArgument} is ${latestReleasedVersion}`)
|
|
77
|
+
publishTag = latestReleasedVersion // set this released beta or alpha to be incremented
|
|
78
|
+
} else {
|
|
79
|
+
console.warn(`No published versions for ${baseVersion} with tag ${tagArgument}`)
|
|
80
|
+
publishTag = baseVersion // start off with a new beta or alpha version
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (packageJSON.version !== publishTag) {
|
|
84
|
+
// report the change for CI
|
|
85
|
+
console.warn(`Changing version in package.json from ${packageJSON.version} to ${publishTag}`)
|
|
86
|
+
|
|
87
|
+
// save the package.json
|
|
88
|
+
packageJSON.version = publishTag
|
|
89
|
+
fs.writeFileSync('package.json', JSON.stringify(packageJSON, null, 2))
|
|
90
|
+
|
|
91
|
+
// perform the same change to the package-lock.json
|
|
92
|
+
const packageLockJSON = JSON.parse(fs.readFileSync('package-lock.json', 'utf8'))
|
|
93
|
+
packageLockJSON.version = publishTag
|
|
94
|
+
fs.writeFileSync('package-lock.json', JSON.stringify(packageLockJSON, null, 2))
|
|
95
|
+
} else {
|
|
96
|
+
console.warn(`Leaving version in package.json at ${packageJSON.version}`)
|
|
97
|
+
}
|
|
@@ -14,13 +14,17 @@ on:
|
|
|
14
14
|
branches: [beta-*.*.*, beta]
|
|
15
15
|
workflow_dispatch:
|
|
16
16
|
|
|
17
|
+
concurrency:
|
|
18
|
+
group: build_and_publish
|
|
19
|
+
cancel-in-progress: true
|
|
20
|
+
|
|
17
21
|
jobs:
|
|
18
22
|
get_tags:
|
|
19
23
|
runs-on: ubuntu-latest
|
|
20
24
|
|
|
21
25
|
steps:
|
|
22
26
|
# checkout repo
|
|
23
|
-
- uses: actions/checkout@
|
|
27
|
+
- uses: actions/checkout@v5
|
|
24
28
|
|
|
25
29
|
# get branch / tag name
|
|
26
30
|
- name: Get Branch / Tag Name
|
|
@@ -47,12 +51,12 @@ jobs:
|
|
|
47
51
|
|
|
48
52
|
steps:
|
|
49
53
|
# checkout repo
|
|
50
|
-
- uses: actions/checkout@
|
|
54
|
+
- uses: actions/checkout@v5
|
|
51
55
|
with:
|
|
52
56
|
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
|
|
53
57
|
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
|
|
54
58
|
|
|
55
|
-
- uses: actions/setup-node@
|
|
59
|
+
- uses: actions/setup-node@v6
|
|
56
60
|
with:
|
|
57
61
|
node-version: lts/*
|
|
58
62
|
|
|
@@ -110,9 +114,9 @@ jobs:
|
|
|
110
114
|
needs: [publish_prod_release]
|
|
111
115
|
runs-on: ubuntu-latest
|
|
112
116
|
steps:
|
|
113
|
-
- uses: actions/checkout@
|
|
117
|
+
- uses: actions/checkout@v5
|
|
114
118
|
- name: Create Release
|
|
115
|
-
uses: softprops/action-gh-release@
|
|
119
|
+
uses: softprops/action-gh-release@v2
|
|
116
120
|
env:
|
|
117
121
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
118
122
|
with:
|
package/CHANGELOG.md
CHANGED
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/).
|
|
4
4
|
|
|
5
|
+
## 0.9.3 (2025-10-18)
|
|
6
|
+
|
|
7
|
+
## [Version 0.9.3](https://github.com/northernman54/homebridge-alexa/compare/0.9.2...0.9.3)
|
|
8
|
+
|
|
9
|
+
#### Changes
|
|
10
|
+
|
|
11
|
+
- Dependency Updates
|
|
12
|
+
|
|
5
13
|
## 0.9.2 (2025-09-13)
|
|
6
14
|
|
|
7
|
-
## [Version 0.9.2](https://github.com/northernman54/homebridge-alexa/compare/
|
|
15
|
+
## [Version 0.9.2](https://github.com/northernman54/homebridge-alexa/compare/0.9.1...0.9.2)
|
|
8
16
|
|
|
9
17
|
#### Changes
|
|
10
18
|
|
|
@@ -12,7 +20,7 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
12
20
|
|
|
13
21
|
## 0.9.1 (2025-08-13)
|
|
14
22
|
|
|
15
|
-
## [Version 0.9.1](https://github.com/northernman54/homebridge-alexa/compare/
|
|
23
|
+
## [Version 0.9.1](https://github.com/northernman54/homebridge-alexa/compare/0.9.0...0.9.1)
|
|
16
24
|
|
|
17
25
|
#### Bug Fix
|
|
18
26
|
|
|
@@ -20,7 +28,7 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
20
28
|
|
|
21
29
|
## 0.9.0 (2025-03-30)
|
|
22
30
|
|
|
23
|
-
## [Version 0.9.0](https://github.com/northernman54/homebridge-alexa/compare/
|
|
31
|
+
## [Version 0.9.0](https://github.com/northernman54/homebridge-alexa/compare/0.8.2...0.9.0)
|
|
24
32
|
|
|
25
33
|
#### Changes
|
|
26
34
|
|
|
@@ -37,7 +45,7 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
37
45
|
|
|
38
46
|
## 0.8.2 (2024-12-27)
|
|
39
47
|
|
|
40
|
-
## [Version 0.8.2](https://github.com/northernman54/homebridge-alexa/compare/
|
|
48
|
+
## [Version 0.8.2](https://github.com/northernman54/homebridge-alexa/compare/0.8.1...0.8.2)
|
|
41
49
|
|
|
42
50
|
#### Bug Fix
|
|
43
51
|
|
|
@@ -45,7 +53,7 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
45
53
|
|
|
46
54
|
## 0.8.1 (2024-12-24)
|
|
47
55
|
|
|
48
|
-
## [Version 0.8.1](https://github.com/northernman54/homebridge-alexa/compare/
|
|
56
|
+
## [Version 0.8.1](https://github.com/northernman54/homebridge-alexa/compare/0.8.0...0.8.1)
|
|
49
57
|
|
|
50
58
|
#### Bug Fix
|
|
51
59
|
|
|
@@ -53,7 +61,7 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
53
61
|
|
|
54
62
|
## 0.8.0 (2024-12-24)
|
|
55
63
|
|
|
56
|
-
## [Version 0.8.0](https://github.com/northernman54/homebridge-alexa/compare/
|
|
64
|
+
## [Version 0.8.0](https://github.com/northernman54/homebridge-alexa/compare/0.7.1...0.8.0)
|
|
57
65
|
|
|
58
66
|
#### Changes
|
|
59
67
|
|
|
@@ -63,7 +71,7 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
63
71
|
|
|
64
72
|
## 0.7.1 (2024-09-24)
|
|
65
73
|
|
|
66
|
-
## [Version 0.7.1](https://github.com/northernman54/homebridge-alexa/compare/
|
|
74
|
+
## [Version 0.7.1](https://github.com/northernman54/homebridge-alexa/compare/0.7.0...0.7.1)
|
|
67
75
|
|
|
68
76
|
#### Changes
|
|
69
77
|
|
|
@@ -73,7 +81,7 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
73
81
|
|
|
74
82
|
## 0.7.0 (2023-05-30)
|
|
75
83
|
|
|
76
|
-
## [Version 0.7.0](https://github.com/northernman54/homebridge-alexa/compare/
|
|
84
|
+
## [Version 0.7.0](https://github.com/northernman54/homebridge-alexa/compare/0.6.9...0.7.0)
|
|
77
85
|
|
|
78
86
|
#### Changes
|
|
79
87
|
|
|
@@ -82,7 +90,7 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
82
90
|
|
|
83
91
|
## 0.6.9 (2023-03-30)
|
|
84
92
|
|
|
85
|
-
## [Version 0.6.9](https://github.com/northernman54/homebridge-alexa/compare/
|
|
93
|
+
## [Version 0.6.9](https://github.com/northernman54/homebridge-alexa/compare/0.6.8...0.6.9)
|
|
86
94
|
|
|
87
95
|
#### Changes
|
|
88
96
|
|
|
@@ -92,7 +100,7 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
92
100
|
|
|
93
101
|
## 0.6.8 (2023-12-13)
|
|
94
102
|
|
|
95
|
-
## [Version 0.6.8](https://github.com/northernman54/homebridge-alexa/compare/
|
|
103
|
+
## [Version 0.6.8](https://github.com/northernman54/homebridge-alexa/compare/0.6.7...0.6.8)
|
|
96
104
|
|
|
97
105
|
#### Changes
|
|
98
106
|
|
|
@@ -100,7 +108,7 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
100
108
|
|
|
101
109
|
## 0.6.7 (2023-09-27)
|
|
102
110
|
|
|
103
|
-
## [Version 0.6.7](https://github.com/northernman54/homebridge-alexa/compare/
|
|
111
|
+
## [Version 0.6.7](https://github.com/northernman54/homebridge-alexa/compare/0.6.6...0.6.7)
|
|
104
112
|
|
|
105
113
|
#### Changes
|
|
106
114
|
|
|
@@ -108,7 +116,7 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
108
116
|
|
|
109
117
|
## 0.6.6 (2023-07-07)
|
|
110
118
|
|
|
111
|
-
## [Version 0.6.6](https://github.com/northernman54/homebridge-alexa/compare/
|
|
119
|
+
## [Version 0.6.6](https://github.com/northernman54/homebridge-alexa/compare/0.6.5...0.6.6)
|
|
112
120
|
|
|
113
121
|
#### Changes
|
|
114
122
|
|
|
@@ -116,7 +124,7 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
116
124
|
|
|
117
125
|
## 0.6.5 (2023-01-03)
|
|
118
126
|
|
|
119
|
-
## [Version 0.6.4](https://github.com/northernman54/homebridge-alexa/compare/
|
|
127
|
+
## [Version 0.6.4](https://github.com/northernman54/homebridge-alexa/compare/0.6.4...0.6.5)
|
|
120
128
|
|
|
121
129
|
#### Changes
|
|
122
130
|
|
|
@@ -124,7 +132,7 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
124
132
|
|
|
125
133
|
## 0.6.4 (2023-01-03)
|
|
126
134
|
|
|
127
|
-
## [Version 0.6.4](https://github.com/northernman54/homebridge-alexa/compare/
|
|
135
|
+
## [Version 0.6.4](https://github.com/northernman54/homebridge-alexa/compare/0.6.3...0.6.4)
|
|
128
136
|
|
|
129
137
|
#### Changes
|
|
130
138
|
|
|
@@ -132,7 +140,7 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
132
140
|
|
|
133
141
|
## 0.6.3 (2023-01-03)
|
|
134
142
|
|
|
135
|
-
## [Version 0.6.3](https://github.com/northernman54/homebridge-alexa/compare/
|
|
143
|
+
## [Version 0.6.3](https://github.com/northernman54/homebridge-alexa/compare/0.6.0...0.6.3)
|
|
136
144
|
|
|
137
145
|
#### Changes
|
|
138
146
|
|
|
@@ -140,7 +148,7 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
140
148
|
|
|
141
149
|
## 0.6.0 (2023-01-03)
|
|
142
150
|
|
|
143
|
-
## [Version 0.6.0](https://github.com/northernman54/homebridge-alexa/compare/
|
|
151
|
+
## [Version 0.6.0](https://github.com/northernman54/homebridge-alexa/compare/0.5.63...v0.6.0)
|
|
144
152
|
|
|
145
153
|
#### Changes
|
|
146
154
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-alexa",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3-beta.0",
|
|
4
4
|
"description": "Control your Homebridge devices with Amazon Alexa.",
|
|
5
5
|
"main": "src/plugin.js",
|
|
6
6
|
"scripts": {
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
],
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@homebridge/hap-client": "^3.1.1",
|
|
38
|
-
"@types/node": "^
|
|
39
|
-
"@types/jest": "^
|
|
38
|
+
"@types/node": "^24.8.1",
|
|
39
|
+
"@types/jest": "^30.0.0",
|
|
40
40
|
"@eslint/js": "^9.14.0",
|
|
41
|
-
"eslint": "^
|
|
42
|
-
"eslint-plugin-format": "^0.
|
|
43
|
-
"eslint-plugin-jest": "^
|
|
44
|
-
"babel-jest": "^
|
|
45
|
-
"globals": "^
|
|
46
|
-
"jest": "^
|
|
41
|
+
"eslint": "^9.37.0",
|
|
42
|
+
"eslint-plugin-format": "^1.0.2",
|
|
43
|
+
"eslint-plugin-jest": "^29.0.1",
|
|
44
|
+
"babel-jest": "^30.2.0",
|
|
45
|
+
"globals": "^16.4.0",
|
|
46
|
+
"jest": "^30.2.0",
|
|
47
47
|
"mqtt-connection": "^4.1.0",
|
|
48
48
|
"nodemon": "^3.1.9",
|
|
49
49
|
"rimraf": "^6.0.1",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"axios": "^1.7.9",
|
|
54
54
|
"bottleneck": "2.19.5",
|
|
55
|
-
"debug": "4.4.
|
|
55
|
+
"debug": "4.4.3",
|
|
56
56
|
"hap-node-client": "^0.2.9",
|
|
57
57
|
"is-my-json-valid": "2.20.6",
|
|
58
|
-
"mqtt": "5.
|
|
58
|
+
"mqtt": "5.14.1"
|
|
59
59
|
},
|
|
60
60
|
"author": "NorthernMan54",
|
|
61
61
|
"license": "Apache-2.0",
|
|
@@ -73,4 +73,4 @@
|
|
|
73
73
|
"src/**"
|
|
74
74
|
]
|
|
75
75
|
}
|
|
76
|
-
}
|
|
76
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
var Homebridges = require('./Homebridges.js').Homebridges;
|
|
2
|
-
const Homebridge = require('./Homebridge');
|
|
3
2
|
|
|
4
3
|
describe('Parse Discovery Response', () => {
|
|
5
4
|
|
|
@@ -7,7 +6,6 @@ describe('Parse Discovery Response', () => {
|
|
|
7
6
|
|
|
8
7
|
const devices = require('../../../test/endPoints.test.json');
|
|
9
8
|
|
|
10
|
-
const message = {};
|
|
11
9
|
const context = {
|
|
12
10
|
pin: '031-45-154',
|
|
13
11
|
filter: null,
|
|
@@ -58,7 +56,6 @@ describe('Parse Discovery Response', () => {
|
|
|
58
56
|
|
|
59
57
|
const devices = require('../../../test/endPoints.test.json');
|
|
60
58
|
|
|
61
|
-
const message = {};
|
|
62
59
|
const context = {
|
|
63
60
|
pin: '031-45-154',
|
|
64
61
|
filter: null,
|