@switchbot/homebridge-switchbot 1.8.2-beta.2 → 1.9.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 +3 -1
- 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 +5 -0
- package/.vscode/settings.json +27 -0
- package/CHANGELOG.md +15 -0
- package/README.md +100 -99
- package/SECURITY.md +2 -2
- package/config.schema.json +9 -0
- package/dist/devices/bots.d.ts +4 -2
- package/dist/devices/bots.d.ts.map +1 -1
- package/dist/devices/bots.js +101 -86
- package/dist/devices/bots.js.map +1 -1
- package/dist/devices/colorbulb.d.ts +15 -15
- package/dist/devices/colorbulb.d.ts.map +1 -1
- package/dist/devices/colorbulb.js +60 -71
- package/dist/devices/colorbulb.js.map +1 -1
- package/dist/devices/contact.d.ts +2 -2
- package/dist/devices/contact.d.ts.map +1 -1
- package/dist/devices/contact.js +33 -31
- package/dist/devices/contact.js.map +1 -1
- package/dist/devices/curtains.d.ts +2 -2
- package/dist/devices/curtains.d.ts.map +1 -1
- package/dist/devices/curtains.js +71 -71
- package/dist/devices/curtains.js.map +1 -1
- package/dist/devices/humidifiers.d.ts +2 -2
- package/dist/devices/humidifiers.d.ts.map +1 -1
- package/dist/devices/humidifiers.js +74 -76
- package/dist/devices/humidifiers.js.map +1 -1
- package/dist/devices/meters.d.ts +2 -2
- package/dist/devices/meters.d.ts.map +1 -1
- package/dist/devices/meters.js +29 -27
- package/dist/devices/meters.js.map +1 -1
- package/dist/devices/motion.d.ts +2 -2
- package/dist/devices/motion.d.ts.map +1 -1
- package/dist/devices/motion.js +34 -32
- package/dist/devices/motion.js.map +1 -1
- package/dist/devices/plugs.d.ts +7 -7
- package/dist/devices/plugs.d.ts.map +1 -1
- package/dist/devices/plugs.js +18 -23
- package/dist/devices/plugs.js.map +1 -1
- package/dist/irdevices/airconditioners.d.ts +2 -2
- package/dist/irdevices/airconditioners.d.ts.map +1 -1
- package/dist/irdevices/airconditioners.js +36 -45
- package/dist/irdevices/airconditioners.js.map +1 -1
- package/dist/irdevices/airpurifiers.d.ts +2 -2
- package/dist/irdevices/airpurifiers.d.ts.map +1 -1
- package/dist/irdevices/airpurifiers.js +12 -17
- package/dist/irdevices/airpurifiers.js.map +1 -1
- package/dist/irdevices/cameras.d.ts +2 -2
- package/dist/irdevices/cameras.d.ts.map +1 -1
- package/dist/irdevices/cameras.js +10 -13
- package/dist/irdevices/cameras.js.map +1 -1
- package/dist/irdevices/fans.d.ts +2 -2
- package/dist/irdevices/fans.d.ts.map +1 -1
- package/dist/irdevices/fans.js +15 -17
- package/dist/irdevices/fans.js.map +1 -1
- package/dist/irdevices/lights.d.ts +2 -2
- package/dist/irdevices/lights.d.ts.map +1 -1
- package/dist/irdevices/lights.js +10 -13
- package/dist/irdevices/lights.js.map +1 -1
- package/dist/irdevices/others.d.ts +2 -2
- package/dist/irdevices/others.d.ts.map +1 -1
- package/dist/irdevices/others.js +10 -13
- package/dist/irdevices/others.js.map +1 -1
- package/dist/irdevices/tvs.d.ts +2 -2
- package/dist/irdevices/tvs.d.ts.map +1 -1
- package/dist/irdevices/tvs.js +22 -30
- package/dist/irdevices/tvs.js.map +1 -1
- package/dist/irdevices/vacuumcleaners.d.ts +2 -2
- package/dist/irdevices/vacuumcleaners.d.ts.map +1 -1
- package/dist/irdevices/vacuumcleaners.js +11 -13
- package/dist/irdevices/vacuumcleaners.js.map +1 -1
- package/dist/irdevices/waterheaters.d.ts +2 -2
- package/dist/irdevices/waterheaters.d.ts.map +1 -1
- package/dist/irdevices/waterheaters.js +10 -13
- package/dist/irdevices/waterheaters.js.map +1 -1
- package/dist/platform.d.ts +3 -3
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +19 -20
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +1 -0
- package/dist/settings.d.ts.map +1 -1
- 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 +12 -8
- package/src/devices/bots.ts +228 -186
- package/src/devices/colorbulb.ts +90 -84
- package/src/devices/contact.ts +85 -78
- package/src/devices/curtains.ts +152 -135
- package/src/devices/humidifiers.ts +162 -137
- package/src/devices/meters.ts +76 -73
- package/src/devices/motion.ts +87 -78
- package/src/devices/plugs.ts +27 -31
- package/src/irdevices/airconditioners.ts +72 -55
- package/src/irdevices/airpurifiers.ts +22 -23
- package/src/irdevices/cameras.ts +18 -19
- package/src/irdevices/fans.ts +27 -25
- package/src/irdevices/lights.ts +18 -20
- package/src/irdevices/others.ts +18 -19
- package/src/irdevices/tvs.ts +33 -41
- package/src/irdevices/vacuumcleaners.ts +19 -19
- package/src/irdevices/waterheaters.ts +21 -31
- package/src/platform.ts +38 -40
- package/src/settings.ts +8 -18
- package/.github/PULL_REQUEST_TEMPLATE/pull_requests.md +0 -27
package/.eslintrc
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
name: Bug-Report
|
|
2
2
|
description: Report a Bug to help us improve
|
|
3
|
-
title:
|
|
3
|
+
title: 'Bug: '
|
|
4
4
|
labels: [bug]
|
|
5
5
|
assignees: 'donavanbecker'
|
|
6
6
|
body:
|
|
@@ -64,7 +64,7 @@ body:
|
|
|
64
64
|
label: Node.js Version
|
|
65
65
|
placeholder: v14.17.6
|
|
66
66
|
validations:
|
|
67
|
-
required: true
|
|
67
|
+
required: true
|
|
68
68
|
- type: input
|
|
69
69
|
attributes:
|
|
70
70
|
label: NPM Version
|
|
@@ -88,7 +88,7 @@ body:
|
|
|
88
88
|
label: Homebridge Config UI X Plugin Version
|
|
89
89
|
placeholder: v4.41.2
|
|
90
90
|
validations:
|
|
91
|
-
required: false
|
|
91
|
+
required: false
|
|
92
92
|
- type: input
|
|
93
93
|
attributes:
|
|
94
94
|
label: Operating System
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
name: Feature Request
|
|
2
2
|
description: Suggest an idea for this project
|
|
3
|
-
title:
|
|
3
|
+
title: 'Feature Request: '
|
|
4
4
|
labels: [enhancement]
|
|
5
5
|
assignees: 'donavanbecker'
|
|
6
6
|
body:
|
|
@@ -15,7 +15,7 @@ body:
|
|
|
15
15
|
- type: input
|
|
16
16
|
attributes:
|
|
17
17
|
label: Problem
|
|
18
|
-
placeholder: A clear and concise description of what the problem is. Ex. I am always frustrated when [...]
|
|
18
|
+
placeholder: A clear and concise description of what the problem is. Ex. I am always frustrated when [...]
|
|
19
19
|
validations:
|
|
20
20
|
required: false
|
|
21
21
|
- type: input
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
name: Support Request
|
|
2
2
|
description: Need help?
|
|
3
|
-
title:
|
|
3
|
+
title: 'Support Request: '
|
|
4
4
|
labels: [question]
|
|
5
5
|
assignees: 'donavanbecker'
|
|
6
6
|
body:
|
|
@@ -52,7 +52,7 @@ body:
|
|
|
52
52
|
label: Node.js Version
|
|
53
53
|
placeholder: v14.17.6
|
|
54
54
|
validations:
|
|
55
|
-
required: true
|
|
55
|
+
required: true
|
|
56
56
|
- type: input
|
|
57
57
|
attributes:
|
|
58
58
|
label: NPM Version
|
|
@@ -76,7 +76,7 @@ body:
|
|
|
76
76
|
label: Homebridge Config UI X Plugin Version
|
|
77
77
|
placeholder: v4.41.2
|
|
78
78
|
validations:
|
|
79
|
-
required: false
|
|
79
|
+
required: false
|
|
80
80
|
- type: input
|
|
81
81
|
attributes:
|
|
82
82
|
label: Operating System
|
package/.github/labeler.yml
CHANGED
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
# the `language` matrix defined below to confirm you have the correct set of
|
|
10
10
|
# supported CodeQL languages.
|
|
11
11
|
#
|
|
12
|
-
name:
|
|
12
|
+
name: 'CodeQL'
|
|
13
13
|
|
|
14
14
|
on:
|
|
15
15
|
push:
|
|
16
|
-
branches: [
|
|
16
|
+
branches: [beta]
|
|
17
17
|
pull_request:
|
|
18
18
|
# The branches below must be a subset of the branches above
|
|
19
|
-
branches: [
|
|
19
|
+
branches: [beta]
|
|
20
20
|
schedule:
|
|
21
21
|
- cron: '39 20 * * 5'
|
|
22
22
|
|
|
@@ -32,40 +32,40 @@ jobs:
|
|
|
32
32
|
strategy:
|
|
33
33
|
fail-fast: false
|
|
34
34
|
matrix:
|
|
35
|
-
language: [
|
|
35
|
+
language: ['javascript']
|
|
36
36
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
|
37
37
|
# Learn more:
|
|
38
38
|
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
|
39
39
|
|
|
40
40
|
steps:
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
- name: Checkout repository
|
|
42
|
+
uses: actions/checkout@v2
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
# Initializes the CodeQL tools for scanning.
|
|
45
|
+
- name: Initialize CodeQL
|
|
46
|
+
uses: github/codeql-action/init@v1
|
|
47
|
+
with:
|
|
48
|
+
languages: ${{ matrix.language }}
|
|
49
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
50
|
+
# By default, queries listed here will override any specified in a config file.
|
|
51
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
52
|
+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
55
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
|
56
|
+
- name: Autobuild
|
|
57
|
+
uses: github/codeql-action/autobuild@v1
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
|
60
|
+
# 📚 https://git.io/JvXDl
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
|
63
|
+
# and modify them (or add more) to build your code if your project
|
|
64
|
+
# uses a compiled language
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
#- run: |
|
|
67
|
+
# make bootstrap
|
|
68
|
+
# make release
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
- name: Perform CodeQL Analysis
|
|
71
|
+
uses: github/codeql-action/analyze@v1
|
|
@@ -25,4 +25,4 @@ jobs:
|
|
|
25
25
|
exempt-pr-labels: 'awaiting-approval,work-in-progress'
|
|
26
26
|
remove-stale-when-updated: true
|
|
27
27
|
close-issue-message: 'This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.'
|
|
28
|
-
close-pr-message: 'This pull request has been automatically closed because it has not had recent activity. Thank you for your contributions.'
|
|
28
|
+
close-pr-message: 'This pull request has been automatically closed because it has not had recent activity. Thank you for your contributions.'
|
package/.prettierrc
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files.eol": "\n",
|
|
3
|
+
"prettier.requireConfig": true,
|
|
4
|
+
"editor.codeActionsOnSave": {
|
|
5
|
+
"source.fixAll.eslint": true
|
|
6
|
+
},
|
|
7
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
8
|
+
"[javascript]": {
|
|
9
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
10
|
+
},
|
|
11
|
+
"[typescript]": {
|
|
12
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
13
|
+
},
|
|
14
|
+
"typescript.format.enable": true,
|
|
15
|
+
"editor.rulers": [
|
|
16
|
+
150
|
|
17
|
+
],
|
|
18
|
+
"eslint.enable": true,
|
|
19
|
+
"eslint.workingDirectories": [
|
|
20
|
+
{
|
|
21
|
+
"mode": "auto"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"[json]": {
|
|
25
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
26
|
+
}
|
|
27
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
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 1.9.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.9.0) (2022-01-20)
|
|
6
|
+
|
|
7
|
+
## What's Changed
|
|
8
|
+
* Add option `allowPush`, this will allow commands to be sent even if device state is already in state that is being pushed.
|
|
9
|
+
* Housekeeping and updated dependencies.
|
|
10
|
+
|
|
11
|
+
**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v1.8.2...v1.9.0
|
|
12
|
+
|
|
13
|
+
## [Version 1.8.2](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.8.2) (2022-01-15)
|
|
14
|
+
|
|
15
|
+
## What's Changed
|
|
16
|
+
* Fixed Bug: Only log config if it is set.
|
|
17
|
+
|
|
18
|
+
**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v1.8.1...v1.8.2
|
|
19
|
+
|
|
5
20
|
## [Version 1.8.1](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.8.1) (2022-01-15)
|
|
6
21
|
|
|
7
22
|
## What's Changed
|
package/README.md
CHANGED
|
@@ -19,29 +19,29 @@ plugin allows you to access your SwitchBot Device(s) from HomeKit with
|
|
|
19
19
|
|
|
20
20
|
1. Search for "SwitchBot" on the plugin screen of [Homebridge Config UI X](https://github.com/oznu/homebridge-config-ui-x)
|
|
21
21
|
2. Find: `@switchbot/homebridge-switchbot`
|
|
22
|
-
|
|
22
|
+
- See noble [prerequisites](https://github.com/homebridge/noble#prerequisites) for your OS. (This is used for BLE connection.)
|
|
23
23
|
3. Click **Install**
|
|
24
24
|
|
|
25
25
|
## Configuration
|
|
26
|
-
* ### If using OpenAPI Connection
|
|
27
|
-
1. Download SwitchBot App on App Store or Google Play Store
|
|
28
|
-
2. Register a SwitchBot account and log in into your account
|
|
29
|
-
3. Generate an Open Token within the App
|
|
30
|
-
- Click Bottom Profile Tab
|
|
31
|
-
- Click Preference
|
|
32
|
-
- Click App version 10 Times, this will enable Developer Options
|
|
33
|
-
- Click Developer Options
|
|
34
|
-
- Click Copy to Clipboard
|
|
35
|
-
4. Input your `openToken` into the config paramter
|
|
36
|
-
* ### If using BLE Connection
|
|
37
|
-
1. Download SwitchBot App on App Store or Google Play Store
|
|
38
|
-
2. Register a SwitchBot account and log in into your account
|
|
39
|
-
3. Click on Device wanting to connect too plugin
|
|
40
|
-
- Click the Settings Gear
|
|
41
|
-
- Click Device Info
|
|
42
|
-
- Copy BLE Mac aka `deviceId`
|
|
43
|
-
4. Input your `deviceId` into the Device Config
|
|
44
26
|
|
|
27
|
+
- ### If using OpenAPI Connection
|
|
28
|
+
1. Download SwitchBot App on App Store or Google Play Store
|
|
29
|
+
2. Register a SwitchBot account and log in into your account
|
|
30
|
+
3. Generate an Open Token within the App
|
|
31
|
+
- Click Bottom Profile Tab
|
|
32
|
+
- Click Preference
|
|
33
|
+
- Click App version 10 Times, this will enable Developer Options
|
|
34
|
+
- Click Developer Options
|
|
35
|
+
- Click Copy to Clipboard
|
|
36
|
+
4. Input your `openToken` into the config paramter
|
|
37
|
+
- ### If using BLE Connection
|
|
38
|
+
1. Download SwitchBot App on App Store or Google Play Store
|
|
39
|
+
2. Register a SwitchBot account and log in into your account
|
|
40
|
+
3. Click on Device wanting to connect too plugin
|
|
41
|
+
- Click the Settings Gear
|
|
42
|
+
- Click Device Info
|
|
43
|
+
- Copy BLE Mac aka `deviceId`
|
|
44
|
+
4. Input your `deviceId` into the Device Config
|
|
45
45
|
|
|
46
46
|
<p align="center">
|
|
47
47
|
|
|
@@ -52,99 +52,100 @@ plugin allows you to access your SwitchBot Device(s) from HomeKit with
|
|
|
52
52
|
## Supported SwitchBot Devices
|
|
53
53
|
|
|
54
54
|
- [SwitchBot Humidifier](https://www.switch-bot.com/products/switchbot-smart-humidifier)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
- Supports OpenAPI & Bluetooth Low Energy (BLE) Connections
|
|
56
|
+
- Can Push Updates over OpenAPI
|
|
57
|
+
- Can Receive Udpates over BLE and OpenAPI
|
|
58
58
|
- [SwitchBot Meter](https://www.switch-bot.com/products/switchbot-meter)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
- Supports OpenAPI & Bluetooth Low Energy (BLE) Connections
|
|
60
|
+
- If using OpenAPI:
|
|
61
|
+
- [SwitchBot Hub Mini](https://www.switch-bot.com/products/switchbot-hub-mini) or [SwitchBot Hub Plus](https://www.switch-bot.com/products/switchbot-hub-plus) Required
|
|
62
|
+
- Enable Cloud Services for Device on SwitchBot App
|
|
63
|
+
- If using Bluetooth Low Energy (BLE) only:
|
|
64
|
+
- Must supply `deviceId` & `deviceName` to Device Config
|
|
65
|
+
- Check `Enable Bluetooth Low Energy (BLE) Connection` on Device Config
|
|
66
66
|
- [SwitchBot Motion Sensor](https://www.switch-bot.com/products/motion-sensor)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
- Supports OpenAPI & Bluetooth Low Energy (BLE) Connections
|
|
68
|
+
- If using OpenAPI:
|
|
69
|
+
- [SwitchBot Hub Mini](https://www.switch-bot.com/products/switchbot-hub-mini) or [SwitchBot Hub Plus](https://www.switch-bot.com/products/switchbot-hub-plus) Required
|
|
70
|
+
- Enable Cloud Services for Device on SwitchBot App
|
|
71
|
+
- If using Bluetooth Low Energy (BLE) only:
|
|
72
|
+
- Must supply `deviceId` & `deviceName` to Device Config
|
|
73
|
+
- Check `Enable Bluetooth Low Energy (BLE) Connection` on Device Config
|
|
74
74
|
- [SwitchBot Contact Sensor](https://www.switch-bot.com/products/contact-sensor)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
- Supports OpenAPI & Bluetooth Low Energy (BLE) Connections
|
|
76
|
+
- If using OpenAPI:
|
|
77
|
+
- [SwitchBot Hub Mini](https://www.switch-bot.com/products/switchbot-hub-mini) or [SwitchBot Hub Plus](https://www.switch-bot.com/products/switchbot-hub-plus) Required
|
|
78
|
+
- Enable Cloud Services for Device on SwitchBot App
|
|
79
|
+
- If using Bluetooth Low Energy (BLE) only:
|
|
80
|
+
- Must supply `deviceId` & `deviceName` to Device Config
|
|
81
|
+
- Check `Enable Bluetooth Low Energy (BLE) Connection` on Device Config
|
|
82
82
|
- [SwitchBot Curtain](https://www.switch-bot.com/products/switchbot-curtain)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
- Supports OpenAPI & Bluetooth Low Energy (BLE) Connections
|
|
84
|
+
- If using OpenAPI:
|
|
85
|
+
- [SwitchBot Hub Mini](https://www.switch-bot.com/products/switchbot-hub-mini) or [SwitchBot Hub Plus](https://www.switch-bot.com/products/switchbot-hub-plus) Required
|
|
86
|
+
- Enable Cloud Services for Device on SwitchBot App
|
|
87
|
+
- If using Bluetooth Low Energy (BLE) only:
|
|
88
|
+
- Must supply `deviceId` & `deviceName` to Device Config
|
|
89
|
+
- Check `Enable Bluetooth Low Energy (BLE) Connection` on Device Config
|
|
90
90
|
- [SwitchBot Bulb](https://www.switch-bot.com/products/switchbot-color-bulb)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
- Supports OpenAPI Connection Only
|
|
92
|
+
- If using OpenAPI:
|
|
93
|
+
- [SwitchBot Hub Mini](https://www.switch-bot.com/products/switchbot-hub-mini) or [SwitchBot Hub Plus](https://www.switch-bot.com/products/switchbot-hub-plus) Required
|
|
94
|
+
- Enable Cloud Services for Device on SwitchBot App
|
|
95
95
|
- [SwitchBot Bot](https://www.switch-bot.com/products/switchbot-bot)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
96
|
+
- Supports OpenAPI & Bluetooth Low Energy (BLE) Connections
|
|
97
|
+
- If using OpenAPI:
|
|
98
|
+
- [SwitchBot Hub Mini](https://www.switch-bot.com/products/switchbot-hub-mini) or [SwitchBot Hub Plus](https://www.switch-bot.com/products/switchbot-hub-plus) Required
|
|
99
|
+
- Enable Cloud Services for Device on SwitchBot App
|
|
100
|
+
- You must set your Bot's Device ID in the Press Mode or Switch Mode Bot Settings (Advanced Settings > Device Settings > Bot Settings)
|
|
101
|
+
- Press Mode - Turns on then instantly turn it off
|
|
102
|
+
- Switch Mode - Turns on and keep it on until it is turned off
|
|
103
|
+
- This can get out of sync, since API doesn't give me a status
|
|
104
|
+
- To Correct you must go into the SwitchBot App and correct the status of either `On` or `Off`
|
|
105
|
+
- If using Bluetooth Low Energy (BLE) only:
|
|
106
|
+
- Must supply `deviceId` & `deviceName` to Device Config
|
|
107
|
+
- Check `Enable Bluetooth Low Energy (BLE) Connection` on Device Config
|
|
108
108
|
- SwitchBot Plug
|
|
109
|
-
|
|
109
|
+
- Supports OpenAPI Connection Only
|
|
110
110
|
|
|
111
111
|
## Supported IR Devices
|
|
112
|
+
|
|
112
113
|
### _(All IR Devices require [Hub Plus](https://www.switch-bot.com/products/switchbot-hub-plus) or [Hub Mini](https://www.switch-bot.com/products/switchbot-hub-mini))_
|
|
113
114
|
|
|
114
115
|
- TV
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
- Allows for On/Off and Volume Controls
|
|
117
|
+
- Optional Disable Sending Power Command
|
|
117
118
|
- Projector (Displayed as TV)
|
|
118
|
-
|
|
119
|
-
- Set Top Box
|
|
120
|
-
|
|
121
|
-
- DVD
|
|
122
|
-
|
|
123
|
-
- Streamer
|
|
124
|
-
|
|
125
|
-
- Speaker
|
|
126
|
-
|
|
119
|
+
- Allows for On/Off and Volume Controls
|
|
120
|
+
- Set Top Box (Displayed as Set Top Box)
|
|
121
|
+
- Allows for On/Off and Volume Controls
|
|
122
|
+
- DVD (Displayed as Set Top Box)
|
|
123
|
+
- Allows for On/Off and Volume Controls
|
|
124
|
+
- Streamer (Displayed as Streaming Stick)
|
|
125
|
+
- Allows for On/Off and Volume Controls
|
|
126
|
+
- Speaker (Displayed as Speaker)
|
|
127
|
+
- Allows for On/Off and Volume Controls
|
|
127
128
|
- Fans
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
- Lights
|
|
132
|
-
|
|
129
|
+
- Allows for On/Off Controls
|
|
130
|
+
- Optional Rotation Speed
|
|
131
|
+
- Optional Swing Mode
|
|
132
|
+
- Lights
|
|
133
|
+
- Allows for On/Off Controls
|
|
133
134
|
- Air Purifiers
|
|
134
|
-
|
|
135
|
+
- Allows for On/Off Controls
|
|
135
136
|
- Air Conditioners
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
- Cameras
|
|
139
|
-
|
|
140
|
-
- Vacuum Cleaners
|
|
141
|
-
|
|
142
|
-
- Water Heaters
|
|
143
|
-
|
|
144
|
-
- Others
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
137
|
+
- Allows for On/Off, Tempeture, and Mode Controls
|
|
138
|
+
- Optional Disable Auto Mode
|
|
139
|
+
- Cameras
|
|
140
|
+
- Allows for On/Off Controls
|
|
141
|
+
- Vacuum Cleaners
|
|
142
|
+
- Allows for On/Off Controls
|
|
143
|
+
- Water Heaters
|
|
144
|
+
- Allows for On/Off Controls
|
|
145
|
+
- Others
|
|
146
|
+
- Option to Dispaly as differenet Device Type
|
|
147
|
+
- Supports Fan Device Type
|
|
148
|
+
- Allows for On/Off Controls
|
|
148
149
|
|
|
149
150
|
## SwitchBotAPI
|
|
150
151
|
|
|
@@ -153,6 +154,6 @@ plugin allows you to access your SwitchBot Device(s) from HomeKit with
|
|
|
153
154
|
|
|
154
155
|
## Community
|
|
155
156
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
- [SwitchBot (Official website)](https://www.switch-bot.com/)
|
|
158
|
+
- [Facebook @SwitchBotRobot](https://www.facebook.com/SwitchBotRobot/)
|
|
159
|
+
- [Twitter @SwitchBot](https://twitter.com/switchbot)
|
package/SECURITY.md
CHANGED
package/config.schema.json
CHANGED
|
@@ -243,6 +243,14 @@
|
|
|
243
243
|
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Bot' && model.options.devices[arrayIndices].deviceId && model.options.devices[arrayIndices].bot && model.options.devices[arrayIndices].bot.mode);"
|
|
244
244
|
}
|
|
245
245
|
},
|
|
246
|
+
"allowPush": {
|
|
247
|
+
"title": "Allow Changes to Be Pushed",
|
|
248
|
+
"description": "If set to true, this will allow commands to be sent even if device state is already in state that is being pushed.",
|
|
249
|
+
"type": "boolean",
|
|
250
|
+
"condition": {
|
|
251
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Bot' && model.options.devices[arrayIndices].deviceId && model.options.devices[arrayIndices].bot && model.options.devices[arrayIndices].bot.mode);"
|
|
252
|
+
}
|
|
253
|
+
},
|
|
246
254
|
"doublePress": {
|
|
247
255
|
"title": "Do you want to similate a double press?",
|
|
248
256
|
"type": "number",
|
|
@@ -900,6 +908,7 @@
|
|
|
900
908
|
"options.devices[].scanDuration",
|
|
901
909
|
"options.devices[].bot.mode",
|
|
902
910
|
"options.devices[].bot.deviceType",
|
|
911
|
+
"options.devices[].bot.allowPush",
|
|
903
912
|
"options.devices[].bot.doublePress",
|
|
904
913
|
"options.devices[].meter.hide_temperature",
|
|
905
914
|
"options.devices[].meter.hide_humidity",
|
package/dist/devices/bots.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export declare class Bot {
|
|
|
36
36
|
state: serviceData['state'];
|
|
37
37
|
battery: serviceData['battery'];
|
|
38
38
|
botMode: string;
|
|
39
|
+
allowPush?: boolean;
|
|
39
40
|
scanDuration: number;
|
|
40
41
|
deviceLogging: string;
|
|
41
42
|
deviceRefreshRate: number;
|
|
@@ -82,6 +83,7 @@ export declare class Bot {
|
|
|
82
83
|
scan(device: device & devicesConfig): void;
|
|
83
84
|
logs(device: device & devicesConfig): void;
|
|
84
85
|
PressOrSwitch(device: device & devicesConfig): void;
|
|
86
|
+
allowPushChanges(device: device & devicesConfig): void;
|
|
85
87
|
removeOutletService(accessory: PlatformAccessory): void;
|
|
86
88
|
removeGarageDoorService(accessory: PlatformAccessory): void;
|
|
87
89
|
removeDoorService(accessory: PlatformAccessory): void;
|
|
@@ -93,8 +95,8 @@ export declare class Bot {
|
|
|
93
95
|
removeStatefulProgrammableSwitchService(accessory: PlatformAccessory): void;
|
|
94
96
|
removeSwitchService(accessory: PlatformAccessory): void;
|
|
95
97
|
/**
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
* Logging for Device
|
|
99
|
+
*/
|
|
98
100
|
infoLog(...log: any[]): void;
|
|
99
101
|
warnLog(...log: any[]): void;
|
|
100
102
|
errorLog(...log: any[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bots.d.ts","sourceRoot":"","sources":["../../src/devices/bots.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bots.d.ts","sourceRoot":"","sources":["../../src/devices/bots.ts"],"names":[],"mappings":"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"}
|