@switchbot/homebridge-switchbot 1.8.3-beta.0 → 1.10.1-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/.eslintrc +14 -45
- package/.github/ISSUE_TEMPLATE/bug-report.yml +3 -3
- package/.github/ISSUE_TEMPLATE/feature-request.yml +2 -2
- package/.github/ISSUE_TEMPLATE/support-request.yml +3 -3
- package/.github/labeler.yml +1 -1
- package/.github/workflows/codeql-analysis.yml +29 -29
- package/.github/workflows/nodejs-beta.yml +1 -1
- package/.github/workflows/prerelease-beta.js +1 -1
- package/.github/workflows/stale.yml +1 -1
- package/.prettierrc +9 -0
- package/.vscode/extensions.json +2 -4
- package/.vscode/settings.json +14 -2
- package/CHANGELOG.md +16 -0
- package/README.md +100 -99
- package/SECURITY.md +2 -2
- package/config.schema.json +17 -0
- package/dist/devices/bots.d.ts +35 -32
- package/dist/devices/bots.d.ts.map +1 -1
- package/dist/devices/bots.js +168 -210
- package/dist/devices/bots.js.map +1 -1
- package/dist/devices/colorbulb.d.ts +35 -35
- package/dist/devices/colorbulb.d.ts.map +1 -1
- package/dist/devices/colorbulb.js +83 -108
- package/dist/devices/colorbulb.js.map +1 -1
- package/dist/devices/contact.d.ts +27 -25
- package/dist/devices/contact.d.ts.map +1 -1
- package/dist/devices/contact.js +110 -131
- package/dist/devices/contact.js.map +1 -1
- package/dist/devices/curtains.d.ts +29 -27
- package/dist/devices/curtains.d.ts.map +1 -1
- package/dist/devices/curtains.js +147 -182
- package/dist/devices/curtains.js.map +1 -1
- package/dist/devices/humidifiers.d.ts +31 -31
- package/dist/devices/humidifiers.d.ts.map +1 -1
- package/dist/devices/humidifiers.js +154 -181
- package/dist/devices/humidifiers.js.map +1 -1
- package/dist/devices/meters.d.ts +29 -28
- package/dist/devices/meters.d.ts.map +1 -1
- package/dist/devices/meters.js +98 -120
- package/dist/devices/meters.js.map +1 -1
- package/dist/devices/motion.d.ts +24 -23
- package/dist/devices/motion.d.ts.map +1 -1
- package/dist/devices/motion.js +97 -113
- package/dist/devices/motion.js.map +1 -1
- package/dist/devices/plugs.d.ts +16 -16
- package/dist/devices/plugs.d.ts.map +1 -1
- package/dist/devices/plugs.js +48 -71
- package/dist/devices/plugs.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -22
- package/dist/index.js.map +1 -1
- package/dist/irdevices/airconditioners.d.ts +7 -4
- package/dist/irdevices/airconditioners.d.ts.map +1 -1
- package/dist/irdevices/airconditioners.js +72 -93
- package/dist/irdevices/airconditioners.js.map +1 -1
- package/dist/irdevices/airpurifiers.d.ts +3 -3
- package/dist/irdevices/airpurifiers.d.ts.map +1 -1
- package/dist/irdevices/airpurifiers.js +32 -51
- package/dist/irdevices/airpurifiers.js.map +1 -1
- package/dist/irdevices/cameras.d.ts +3 -3
- package/dist/irdevices/cameras.d.ts.map +1 -1
- package/dist/irdevices/cameras.js +19 -26
- package/dist/irdevices/cameras.js.map +1 -1
- package/dist/irdevices/fans.d.ts +3 -3
- package/dist/irdevices/fans.d.ts.map +1 -1
- package/dist/irdevices/fans.js +35 -44
- package/dist/irdevices/fans.js.map +1 -1
- package/dist/irdevices/lights.d.ts +3 -3
- package/dist/irdevices/lights.d.ts.map +1 -1
- package/dist/irdevices/lights.js +25 -32
- package/dist/irdevices/lights.js.map +1 -1
- package/dist/irdevices/others.d.ts +3 -3
- package/dist/irdevices/others.d.ts.map +1 -1
- package/dist/irdevices/others.js +21 -29
- package/dist/irdevices/others.js.map +1 -1
- package/dist/irdevices/tvs.d.ts +3 -3
- package/dist/irdevices/tvs.d.ts.map +1 -1
- package/dist/irdevices/tvs.js +66 -89
- package/dist/irdevices/tvs.js.map +1 -1
- package/dist/irdevices/vacuumcleaners.d.ts +3 -3
- package/dist/irdevices/vacuumcleaners.d.ts.map +1 -1
- package/dist/irdevices/vacuumcleaners.js +18 -24
- package/dist/irdevices/vacuumcleaners.js.map +1 -1
- package/dist/irdevices/waterheaters.d.ts +3 -3
- package/dist/irdevices/waterheaters.d.ts.map +1 -1
- package/dist/irdevices/waterheaters.js +19 -26
- package/dist/irdevices/waterheaters.js.map +1 -1
- package/dist/platform.d.ts +10 -10
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +163 -233
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +3 -1
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +4 -4
- package/dist/settings.js.map +1 -1
- package/homebridge-ui/public/index.html +231 -245
- package/homebridge-ui/server.js +2 -4
- package/nodemon.json +2 -4
- package/package.json +17 -12
- package/src/devices/bots.ts +411 -854
- package/src/devices/colorbulb.ts +187 -408
- package/src/devices/contact.ts +210 -376
- package/src/devices/curtains.ts +288 -563
- package/src/devices/humidifiers.ts +291 -537
- package/src/devices/meters.ts +189 -331
- package/src/devices/motion.ts +188 -322
- package/src/devices/plugs.ts +88 -160
- package/src/index.ts +5 -5
- package/src/irdevices/airconditioners.ts +139 -318
- package/src/irdevices/airpurifiers.ts +71 -170
- package/src/irdevices/cameras.ts +44 -103
- package/src/irdevices/fans.ts +70 -165
- package/src/irdevices/lights.ts +49 -104
- package/src/irdevices/others.ts +55 -131
- package/src/irdevices/tvs.ts +114 -247
- package/src/irdevices/vacuumcleaners.ts +44 -104
- package/src/irdevices/waterheaters.ts +49 -121
- package/src/platform.ts +341 -753
- package/src/settings.ts +8 -11
- package/tsconfig.json +5 -14
- package/.github/PULL_REQUEST_TEMPLATE/pull_requests.md +0 -27
package/src/settings.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { MacAddress, PlatformConfig } from
|
|
1
|
+
import { MacAddress, PlatformConfig } from 'homebridge';
|
|
2
2
|
/**
|
|
3
3
|
* This is the name of the platform that users will use to register the plugin in the Homebridge config.json
|
|
4
4
|
*/
|
|
5
|
-
export const PLATFORM_NAME =
|
|
5
|
+
export const PLATFORM_NAME = 'SwitchBot';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* This must match the name of your plugin as defined the package.json
|
|
9
9
|
*/
|
|
10
|
-
export const PLUGIN_NAME =
|
|
10
|
+
export const PLUGIN_NAME = '@switchbot/homebridge-switchbot';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* This is the main url used to access SwitchBot API
|
|
14
14
|
*/
|
|
15
|
-
export const AuthURL =
|
|
15
|
+
export const AuthURL = 'https://api.switch-bot.com';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* This is the main url used to access SwitchBot API
|
|
19
19
|
*/
|
|
20
|
-
export const DeviceURL =
|
|
20
|
+
export const DeviceURL = 'https://api.switch-bot.com/v1.0/devices';
|
|
21
21
|
|
|
22
22
|
//Config
|
|
23
23
|
export interface SwitchBotPlatformConfig extends PlatformConfig {
|
|
@@ -66,6 +66,7 @@ export type bot = {
|
|
|
66
66
|
mode?: string;
|
|
67
67
|
deviceType?: string;
|
|
68
68
|
doublePress?: number;
|
|
69
|
+
allowPush?: boolean;
|
|
69
70
|
};
|
|
70
71
|
|
|
71
72
|
export type humidifier = {
|
|
@@ -146,6 +147,7 @@ export type set_min = {
|
|
|
146
147
|
|
|
147
148
|
export type irair = {
|
|
148
149
|
hide_automode?: boolean;
|
|
150
|
+
pushOn?: boolean
|
|
149
151
|
};
|
|
150
152
|
|
|
151
153
|
export type irtv = {
|
|
@@ -326,12 +328,7 @@ export type temperature = {
|
|
|
326
328
|
};
|
|
327
329
|
|
|
328
330
|
export type switchbot = {
|
|
329
|
-
discover: (arg0: {
|
|
330
|
-
duration?: any;
|
|
331
|
-
model: string;
|
|
332
|
-
quick: boolean;
|
|
333
|
-
id?: MacAddress;
|
|
334
|
-
}) => Promise<any>;
|
|
331
|
+
discover: (arg0: { duration?: any; model: string; quick: boolean; id?: MacAddress }) => Promise<any>;
|
|
335
332
|
wait: (arg0: number) => any;
|
|
336
333
|
};
|
|
337
334
|
|
package/tsconfig.json
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
3
|
+
"target": "ES2021",
|
|
4
4
|
"module": "commonjs",
|
|
5
|
-
"lib": [
|
|
6
|
-
"es2015",
|
|
7
|
-
"es2016",
|
|
8
|
-
"es2017",
|
|
9
|
-
"es2018"
|
|
10
|
-
],
|
|
5
|
+
"lib": ["ES2015", "ES2016", "ES2017", "ES2018", "ES2019", "ES2020", "ES2021"],
|
|
11
6
|
"declaration": true,
|
|
12
7
|
"declarationMap": true,
|
|
13
8
|
"sourceMap": true,
|
|
@@ -17,10 +12,6 @@
|
|
|
17
12
|
"esModuleInterop": true,
|
|
18
13
|
"noImplicitAny": false
|
|
19
14
|
},
|
|
20
|
-
"include": [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"exclude": [
|
|
24
|
-
"**/*.spec.ts"
|
|
25
|
-
]
|
|
26
|
-
}
|
|
15
|
+
"include": ["src/"],
|
|
16
|
+
"exclude": ["**/*.spec.ts"]
|
|
17
|
+
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Enhancement
|
|
3
|
-
about: Contribute to Plugin through Pull Request
|
|
4
|
-
title: ''
|
|
5
|
-
labels: 'enhancement'
|
|
6
|
-
assignees: 'donavanbecker'
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
**Is your enhancement related to a problem? Please describe.**
|
|
10
|
-
|
|
11
|
-
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
|
|
12
|
-
|
|
13
|
-
**Describe the solution you are addding**
|
|
14
|
-
|
|
15
|
-
<!-- A clear and concise description of what you want to happen. -->
|
|
16
|
-
|
|
17
|
-
**Changes Proposed in this Pull Request**
|
|
18
|
-
|
|
19
|
-
<!-- A clear and concise description of what is being changed. -->
|
|
20
|
-
|
|
21
|
-
**Describe alternatives you've considered**
|
|
22
|
-
|
|
23
|
-
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
|
|
24
|
-
|
|
25
|
-
**Additional context**
|
|
26
|
-
|
|
27
|
-
<!-- Add any other context or screenshots about the feature request here. -->
|