@switchbot/homebridge-switchbot-ble
Advanced tools
Comparing version 1.0.1 to 1.1.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Bot = void 0; | ||
class Bot { | ||
@@ -4,0 +5,0 @@ constructor(hap, log, name, bleMac, scanDuration) { |
"use strict"; | ||
const bot_accessory_1 = require("./bot-accessory"); | ||
const curtain_accessory_1 = require("./curtain-accessory"); | ||
const PLATFORM_NAME = "SwitchBotPlatform"; | ||
@@ -41,3 +42,2 @@ /* | ||
accessories(callback) { | ||
this.log.info("this.config"); | ||
let deviceList = []; | ||
@@ -49,5 +49,12 @@ for (var device of this.config.devices) { | ||
// this.log.info(device.scanDuration, typeof device.scanDuration); | ||
if (device.type == 'bot') { | ||
let scanDuration = device.scanDuration || 1000; | ||
deviceList.push(new bot_accessory_1.Bot(hap, this.log, device.name, device.bleMac.toLowerCase(), scanDuration)); | ||
let scanDuration = device.scanDuration || 1000; | ||
switch (device.type) { | ||
case 'bot': | ||
deviceList.push(new bot_accessory_1.Bot(hap, this.log, device.name, device.bleMac.toLowerCase(), scanDuration)); | ||
break; | ||
case 'curtain': | ||
deviceList.push(new curtain_accessory_1.Curtain(hap, this.log, device.name, device.bleMac.toLowerCase(), scanDuration)); | ||
break; | ||
default: | ||
break; | ||
} | ||
@@ -54,0 +61,0 @@ } |
{ | ||
"name": "@switchbot/homebridge-switchbot-ble", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Homebridge integration for SwitchBot BLE series products", | ||
@@ -36,11 +36,11 @@ "license": "ISC", | ||
"devDependencies": { | ||
"@types/node": "10.17.19", | ||
"homebridge": "^1.0.4", | ||
"@types/node": "14.14.6", | ||
"homebridge": "^1.1.6", | ||
"rimraf": "^3.0.2", | ||
"typescript": "^3.8.3" | ||
"typescript": "^4.0.5" | ||
}, | ||
"dependencies": { | ||
"@abandonware/noble": "^1.9.2-10", | ||
"node-switchbot": "0.0.5" | ||
"node-switchbot": "0.1.0" | ||
} | ||
} |
@@ -10,3 +10,9 @@ <span align="center"> | ||
The @switchbot/homebridge-switchbot-bleswitchbot is a nodejs module , and also a homebridge plug-in that directly controls SwitchBot products via BLE. | ||
Now supports: | ||
* [SwitchBot (Bot)](https://www.switch-bot.com/products/switchbot-bot) | ||
* [SwitchBot Curtain(Curtain)](https://www.switch-bot.com/products/switchbot-curtain) | ||
## Installation | ||
@@ -24,2 +30,4 @@ ### Installing bluetooth libraries | ||
``` | ||
You can also install it on the homebridge plugins page. | ||
![homebridge-plugins-search](image/homebridge-plugins-search.png) | ||
@@ -53,2 +61,8 @@ ## Configuration | ||
"scanDuration": 2000 | ||
}, | ||
{ | ||
"type": "curtain", | ||
"name": "Curtain 11", | ||
"bleMac": "ec:58:c5:d0:01:11", | ||
"scanDuration": 2000 | ||
} | ||
@@ -62,3 +76,3 @@ ] | ||
* `devices` - SwitchBot devices list. | ||
* `type` - Device type. Currently only `bot` is supported. | ||
* `type` - Device type. Currently only supports `bot` and `curtain`. | ||
* `name` - Device name. | ||
@@ -69,1 +83,13 @@ * `bleMac` - Device mac address. You can find it in App settings. | ||
* `scanDuration` - Scan timeout. BLE Central must first scan the advertising. Default is `1000`(unit: ms). Longer time to ensure device discovery but slower response. | ||
## Release-Note | ||
* v1.1.0 (2020-10-29) | ||
* Add support for Curtain. | ||
* v1.0.1 (2020-10-22) | ||
* First public release, supports Bot. | ||
## Community | ||
* [SwitchBot (Official website)](https://www.switch-bot.com/) | ||
* [Facebook @SwitchBotRobot](https://www.facebook.com/SwitchBotRobot/) | ||
* [Twitter @SwitchBot](https://twitter.com/switchbot) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25245
9
264
90
+ Addednode-switchbot@0.1.0(transitive)
- Removednode-switchbot@0.0.5(transitive)
Updatednode-switchbot@0.1.0