@switchbot/homebridge-switchbot 3.5.2-beta.3 → 3.6.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 +11 -0
- package/README.md +10 -6
- package/config.schema.json +6 -0
- package/package.json +3 -3
- package/.github/npm-version-script.cjs +0 -81
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +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
|
+
## [3.6.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v3.6.0) (2024-07-06)
|
|
6
|
+
|
|
7
|
+
### What's Changed
|
|
8
|
+
- Add Humdifier as `meterType` for IR AirConditioner
|
|
9
|
+
- Fix Bot `botDeviceType` issue
|
|
10
|
+
- Fix Other IR `deviceType` issue
|
|
11
|
+
- Fix `RangeError: Maximum call stack size exceeded` error
|
|
12
|
+
- Housekeeping and updated dependencies.
|
|
13
|
+
|
|
14
|
+
**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v3.5.1...v3.6.0
|
|
15
|
+
|
|
5
16
|
## [3.5.1](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v3.5.1) (2024-06-27)
|
|
6
17
|
|
|
7
18
|
### What's Changed
|
package/README.md
CHANGED
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
- Must supply `deviceId` & `deviceName` to Device Config
|
|
109
109
|
- Check `Enable Bluetooth Low Energy (BLE) Connection` on Device Config
|
|
110
110
|
- [SwitchBot Blind Tilt](https://us.switch-bot.com/products/switchbot-blind-tilt)
|
|
111
|
-
- Supports OpenAPI
|
|
111
|
+
- Supports OpenAPI & partial Bluetooth Low Energy (BLE) Connections
|
|
112
112
|
- If using OpenAPI:
|
|
113
113
|
- [SwitchBot Hub Mini](https://www.switch-bot.com/products/switchbot-hub-mini) or [SwitchBot Hub 2](https://us.switch-bot.com/products/switchbot-hub-2) Required
|
|
114
114
|
- Enable Cloud Services for Device on SwitchBot App
|
|
@@ -116,13 +116,13 @@
|
|
|
116
116
|
- [SwitchBot Ceiling Light](https://www.switchbot.jp/collections/all/products/switchbot-ceiling-light)
|
|
117
117
|
- [SwitchBot Ceiling Light Pro](https://www.switchbot.jp/collections/all/products/switchbot-ceiling-light)
|
|
118
118
|
- [SwitchBot Light Strip](https://www.switch-bot.com/products/switchbot-light-strip)
|
|
119
|
-
- Supports OpenAPI
|
|
119
|
+
- Supports OpenAPI & partial Bluetooth Low Energy (BLE) Connections
|
|
120
120
|
- If using OpenAPI:
|
|
121
121
|
- [SwitchBot Hub Mini](https://www.switch-bot.com/products/switchbot-hub-mini) or [SwitchBot Hub 2](https://us.switch-bot.com/products/switchbot-hub-2) Required
|
|
122
122
|
- Enable Cloud Services for Device on SwitchBot App
|
|
123
123
|
- [SwitchBot Lock](https://us.switch-bot.com/products/switchbot-lock)
|
|
124
|
-
- [SwitchBot Lock](https://www.switchbot.jp/products/switchbot-lock-pro)
|
|
125
|
-
- Supports OpenAPI
|
|
124
|
+
- [SwitchBot Lock Pro](https://www.switchbot.jp/products/switchbot-lock-pro)
|
|
125
|
+
- Supports OpenAPI & Bluetooth Low Energy (BLE) Connections
|
|
126
126
|
- If using OpenAPI:
|
|
127
127
|
- [SwitchBot Hub Mini](https://www.switch-bot.com/products/switchbot-hub-mini) or [SwitchBot Hub 2](https://us.switch-bot.com/products/switchbot-hub-2) Required
|
|
128
128
|
- Enable Cloud Services for Device on SwitchBot App
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
- [SwitchBot Plug](https://www.switch-bot.com/products/switchbot-plug)
|
|
135
135
|
- [SwitchBot Plug Mini (US)](https://www.switch-bot.com/products/switchbot-plug-mini)
|
|
136
136
|
- [SwitchBot Plug Mini (JP)](https://www.switchbot.jp/products/switchbot-plug-mini)
|
|
137
|
-
- Supports OpenAPI
|
|
137
|
+
- Supports OpenAPI & Bluetooth Low Energy (BLE) Connections
|
|
138
138
|
- If using OpenAPI:
|
|
139
139
|
- [SwitchBot Hub Mini](https://www.switch-bot.com/products/switchbot-hub-mini) or [SwitchBot Hub 2](https://us.switch-bot.com/products/switchbot-hub-2) Required
|
|
140
140
|
- Enable Cloud Services for Device on SwitchBot App
|
|
@@ -152,8 +152,12 @@
|
|
|
152
152
|
- Must supply `deviceId` & `deviceName` to Device Config
|
|
153
153
|
- Check `Enable Bluetooth Low Energy (BLE) Connection` on Device Config
|
|
154
154
|
- [SwitchBot Hub 2](https://us.switch-bot.com/products/switchbot-hub-2)
|
|
155
|
+
- Supports OpenAPI & Bluetooth Low Energy (BLE) Connections
|
|
156
|
+
- Enables Humidity, Temperature, and Light Sensor
|
|
157
|
+
- [SwitchBot Battery Circulator Fan](https://us.switch-bot.com/products/switchbot-battery-circulator-fan)
|
|
158
|
+
- Supports OpenAPI Connection Only
|
|
159
|
+
- [SwitchBot Water Leak Detector](https://us.switch-bot.com/products/switchbot-water-leak-detector)
|
|
155
160
|
- Supports OpenAPI Connection Only
|
|
156
|
-
- Enables Humidity and Temperature Sensor
|
|
157
161
|
|
|
158
162
|
## Supported IR Devices
|
|
159
163
|
|
package/config.schema.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "SwitchBot",
|
|
3
3
|
"name": "@switchbot/homebridge-switchbot",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.6.0",
|
|
5
5
|
"description": "The SwitchBot plugin allows you to access your SwitchBot device(s) from HomeKit.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "SwitchBot",
|
|
@@ -91,14 +91,14 @@
|
|
|
91
91
|
"@eslint/js": "^9.6.0",
|
|
92
92
|
"@stylistic/eslint-plugin": "^2.3.0",
|
|
93
93
|
"@types/eslint__js": "^8.42.3",
|
|
94
|
-
"@types/node": "^20.14.
|
|
94
|
+
"@types/node": "^20.14.10",
|
|
95
95
|
"eslint": "^9.6.0",
|
|
96
96
|
"globals": "^15.8.0",
|
|
97
97
|
"homebridge": "^1.8.3",
|
|
98
98
|
"homebridge-config-ui-x": "4.56.4",
|
|
99
99
|
"nodemon": "^3.1.4",
|
|
100
100
|
"npm-check-updates": "^16.14.20",
|
|
101
|
-
"rimraf": "^5.0.
|
|
101
|
+
"rimraf": "^5.0.8",
|
|
102
102
|
"ts-node": "^10.9.2",
|
|
103
103
|
"typescript": "^5.5.3",
|
|
104
104
|
"typescript-eslint": "^8.0.0-alpha.39"
|
|
@@ -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.cjs <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));
|