@switchbot/homebridge-switchbot 2.13.0-beta.0 → 2.13.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/CHANGELOG.md +9 -0
- package/README.md +3 -2
- package/package.json +9 -9
- package/.github/npm-version-script.js +0 -81
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
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
|
+
## [Version 2.13.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v2.13.0) (2023-12-04)
|
|
6
|
+
|
|
7
|
+
## What's Changed
|
|
8
|
+
|
|
9
|
+
- Add support for turning on `WoSweeperMini`, also known as `SwitchBot Mini Robot Vacuum K10+`
|
|
10
|
+
- Housekeeping and updated dependencies.
|
|
11
|
+
|
|
12
|
+
**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v2.12.1...v2.13.0
|
|
13
|
+
|
|
5
14
|
## [Version 2.12.1](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v2.12.1) (2023-11-26)
|
|
6
15
|
|
|
7
16
|
## What's Changed
|
package/README.md
CHANGED
|
@@ -114,8 +114,9 @@
|
|
|
114
114
|
- If using OpenAPI:
|
|
115
115
|
- [SwitchBot Hub Mini](https://www.switch-bot.com/products/switchbot-hub-mini) or [SwitchBot Hub 2](https://us.switch-bot.com/pages/switchbot-hub-2) Required
|
|
116
116
|
- Enable Cloud Services for Device on SwitchBot App
|
|
117
|
-
- [SwitchBot Robot Vacuum
|
|
118
|
-
- [SwitchBot Robot Vacuum Cleaner S1
|
|
117
|
+
- US: [SwitchBot Mini Robot Vacuum K10+](https://www.switch-bot.com/products/switchbot-mini-robot-vacuum-k10)
|
|
118
|
+
- JP: [SwitchBot Robot Vacuum Cleaner S1](https://www.switchbot.jp/products/switchbot-robot-vacuum-cleaner)
|
|
119
|
+
- JP: [SwitchBot Robot Vacuum Cleaner S1 Plus](https://www.switchbot.jp/products/switchbot-robot-vacuum-cleaner)
|
|
119
120
|
- Supports OpenAPI Connection Only
|
|
120
121
|
- [SwitchBot Plug](https://www.switch-bot.com/products/switchbot-plug)
|
|
121
122
|
- [SwitchBot Plug Mini (US)](https://www.switch-bot.com/products/switchbot-plug-mini)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "SwitchBot",
|
|
3
3
|
"name": "@switchbot/homebridge-switchbot",
|
|
4
|
-
"version": "2.13.0
|
|
4
|
+
"version": "2.13.0",
|
|
5
5
|
"description": "The [Homebridge](https://homebridge.io) SwitchBot plugin allows you to access your [SwitchBot](https://www.switch-bot.com) device(s) from HomeKit.",
|
|
6
6
|
"author": "SwitchBot <support@wondertechlabs.com> (https://github.com/SwitchBot)",
|
|
7
7
|
"license": "ISC",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"lint": "eslint src/**.ts",
|
|
25
25
|
"watch": "npm run build && npm link && nodemon",
|
|
26
26
|
"build": "rimraf ./dist && tsc",
|
|
27
|
-
"prepublishOnly": "npm run
|
|
27
|
+
"prepublishOnly": "npm run lint && npm run build",
|
|
28
28
|
"postpublish": "npm run clean",
|
|
29
29
|
"clean": "rimraf ./dist",
|
|
30
30
|
"test": "eslint src/**.ts"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"fakegato-history": "^0.6.4",
|
|
62
62
|
"homebridge-lib": "^6.7.1",
|
|
63
63
|
"rxjs": "^7.8.1",
|
|
64
|
-
"undici": "^5.28.
|
|
64
|
+
"undici": "^5.28.2"
|
|
65
65
|
},
|
|
66
66
|
"optionalDependencies": {
|
|
67
67
|
"node-switchbot": "^1.9.1",
|
|
@@ -69,15 +69,15 @@
|
|
|
69
69
|
"@abandonware/bluetooth-hci-socket": "^0.5.3-10"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@types/node": "^20.10.
|
|
73
|
-
"@typescript-eslint/eslint-plugin": "^6.13.
|
|
74
|
-
"@typescript-eslint/parser": "^6.13.
|
|
75
|
-
"eslint": "^8.
|
|
72
|
+
"@types/node": "^20.10.3",
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
|
74
|
+
"@typescript-eslint/parser": "^6.13.2",
|
|
75
|
+
"eslint": "^8.55.0",
|
|
76
76
|
"homebridge": "^1.7.0",
|
|
77
|
-
"nodemon": "^3.0.
|
|
77
|
+
"nodemon": "^3.0.2",
|
|
78
78
|
"npm-check-updates": "^16.14.11",
|
|
79
79
|
"rimraf": "^5.0.5",
|
|
80
80
|
"ts-node": "^10.9.1",
|
|
81
81
|
"typescript": "^5.3.2"
|
|
82
82
|
}
|
|
83
|
-
}
|
|
83
|
+
}
|
|
@@ -1,81 +0,0 @@
|
|
|
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 fs = require("fs");
|
|
8
|
-
const semver = require("semver");
|
|
9
|
-
const child_process = require("child_process");
|
|
10
|
-
const assert = require("assert");
|
|
11
|
-
|
|
12
|
-
const BRANCH_VERSION_PATTERN = /^([A-Za-z]*)-(\d+.\d+.\d+)$/
|
|
13
|
-
|
|
14
|
-
// Load the contents of the package.json file
|
|
15
|
-
const packageJSON = JSON.parse(fs.readFileSync("package.json", "utf8"));
|
|
16
|
-
|
|
17
|
-
let refArgument = process.argv[2];
|
|
18
|
-
let tagArgument = process.argv[3] || "latest";
|
|
19
|
-
|
|
20
|
-
if (refArgument == null) {
|
|
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 tag.
|
|
28
|
-
* @param tag The tag to query for.
|
|
29
|
-
* @returns {string} Returns the version.
|
|
30
|
-
*/
|
|
31
|
-
function getTagVersionFromNpm(tag) {
|
|
32
|
-
try {
|
|
33
|
-
return child_process.execSync(`npm info ${packageJSON.name} version --tag="${tag}"`).toString("utf8").trim();
|
|
34
|
-
} catch (e) {
|
|
35
|
-
throw e;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function desiredTargetVersion(ref) {
|
|
40
|
-
// ref is a GitHub action ref string
|
|
41
|
-
if (ref.startsWith("refs/pull/")) {
|
|
42
|
-
throw Error("The version script was executed inside a PR!");
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
assert(ref.startsWith("refs/heads/"))
|
|
46
|
-
let branchName = ref.slice("refs/heads/".length);
|
|
47
|
-
|
|
48
|
-
let results = branchName.match(BRANCH_VERSION_PATTERN);
|
|
49
|
-
if (results != null) {
|
|
50
|
-
if (results[1] !== tagArgument) {
|
|
51
|
-
console.warn(`The base branch name (${results[1]}) differs from the tag name ${tagArgument}`);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return results[2];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// legacy mode were we use the `betaVersion` property in the package.json
|
|
58
|
-
if (branchName === "beta" && packageJSON.betaVersion) {
|
|
59
|
-
return packageJSON.betaVersion
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
throw new Error("Malformed branch name for ref: " + ref + ". Can't derive the base version. Use a branch name like: beta-x.x.x!");
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// derive the base version from the branch ref
|
|
66
|
-
const baseVersion = desiredTargetVersion(refArgument);
|
|
67
|
-
|
|
68
|
-
// query the npm registry for the latest version of the provided tag name
|
|
69
|
-
const latestReleasedVersion = getTagVersionFromNpm(tagArgument); // e.g. 0.7.0-beta.12
|
|
70
|
-
const latestReleaseBase = semver.inc(latestReleasedVersion, "patch"); // will produce 0.7.0 (removing the preid, needed for the equality check below)
|
|
71
|
-
|
|
72
|
-
let publishTag;
|
|
73
|
-
if (semver.eq(baseVersion, latestReleaseBase)) { // check if we are releasing another version for the latest beta
|
|
74
|
-
publishTag = latestReleasedVersion; // set the current latest beta to be incremented
|
|
75
|
-
} else {
|
|
76
|
-
publishTag = baseVersion; // start of with a new beta version
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// save the package.json
|
|
80
|
-
packageJSON.version = publishTag;
|
|
81
|
-
fs.writeFileSync("package.json", JSON.stringify(packageJSON, null, 2));
|