@switchbot/homebridge-switchbot-ble
Advanced tools
Comparing version 1.2.6 to 1.2.7
@@ -14,3 +14,3 @@ "use strict"; | ||
.on("get" /* GET */, (callback) => { | ||
log.info('Current state of Bot was returned: ' + (this.switchOn ? 'ON' : 'OFF')); | ||
log.info("Current state of Bot was returned: " + (this.switchOn ? "ON" : "OFF")); | ||
callback(undefined, this.switchOn); | ||
@@ -23,3 +23,3 @@ }) | ||
if (targetState === this.switchOn) { | ||
log.info('Target state of Bot has not changed: ' + (this.switchOn ? 'ON' : 'OFF')); | ||
log.info("Target state of Bot has not changed: " + (this.switchOn ? "ON" : "OFF")); | ||
(_a = this.botService) === null || _a === void 0 ? void 0 : _a.getCharacteristic(hap.Characteristic.On).updateValue(this.switchOn); | ||
@@ -29,3 +29,3 @@ callback(); | ||
// Target state has been changed. | ||
log.info('Target state of Bot setting: ' + (targetState ? 'ON' : 'OFF')); | ||
log.info("Target state of Bot setting: " + (targetState ? "ON" : "OFF")); | ||
const SwitchBot = require('node-switchbot'); | ||
@@ -36,5 +36,5 @@ const switchbot = new SwitchBot(); | ||
let targetDevice = null; | ||
for (const device of device_list) { | ||
for (let device of device_list) { | ||
// log.info(device.modelName, device.address); | ||
if (device.address === this.bleMac) { | ||
if (device.address == this.bleMac) { | ||
targetDevice = device; | ||
@@ -74,3 +74,3 @@ break; | ||
}, 500); | ||
log.info('Bot state has been set to: ' + (this.switchOn ? 'ON' : 'OFF')); | ||
log.info("Bot state has been set to: " + (this.switchOn ? "ON" : "OFF")); | ||
callback(); | ||
@@ -83,3 +83,3 @@ }).catch((error) => { | ||
}, 500); | ||
log.info('Bot state failed to be set to: ' + (targetState ? 'ON' : 'OFF')); | ||
log.info("Bot state failed to be set to: " + (targetState ? "ON" : "OFF")); | ||
callback(); | ||
@@ -89,6 +89,6 @@ }); | ||
this.informationService = new hap.Service.AccessoryInformation() | ||
.setCharacteristic(hap.Characteristic.Manufacturer, 'SwitchBot') | ||
.setCharacteristic(hap.Characteristic.Model, 'SWITCHBOT-S1') | ||
.setCharacteristic(hap.Characteristic.Manufacturer, "SwitchBot") | ||
.setCharacteristic(hap.Characteristic.Model, "SWITCHBOT-S1") | ||
.setCharacteristic(hap.Characteristic.SerialNumber, this.bleMac); | ||
log.info('Bot \'%s\' created!', name); | ||
log.info("Bot '%s' created!", name); | ||
} | ||
@@ -100,3 +100,3 @@ /* | ||
identify() { | ||
this.log.info('Identify!'); | ||
this.log.info("Identify!"); | ||
} | ||
@@ -103,0 +103,0 @@ /* |
@@ -19,3 +19,3 @@ "use strict"; | ||
.on("get" /* GET */, (callback) => { | ||
log.info('Current position of Curtain was returned: ' + this.currentPosition + '%'); | ||
log.info("Current position of Curtain was returned: " + this.currentPosition + "%"); | ||
callback(undefined, this.currentPosition); | ||
@@ -25,3 +25,3 @@ }); | ||
.on("get" /* GET */, (callback) => { | ||
log.info('Target position of Curtain was returned: ' + this.targetPosition + '%'); | ||
log.info("Target position of Curtain was returned: " + this.targetPosition + "%"); | ||
callback(undefined, this.targetPosition); | ||
@@ -32,3 +32,3 @@ }) | ||
this.targetPosition = value; | ||
log.info('Target position of Curtain setting: ' + this.targetPosition + '%'); | ||
log.info("Target position of Curtain setting: " + this.targetPosition + "%"); | ||
clearTimeout(this.moveTimer); | ||
@@ -56,5 +56,5 @@ if (this.targetPosition > this.currentPosition) { | ||
let targetDevice = null; | ||
for (const device of device_list) { | ||
for (let device of device_list) { | ||
log.info(device.modelName, device.address); | ||
if (device.address === this.bleMac) { | ||
if (device.address == this.bleMac) { | ||
targetDevice = device; | ||
@@ -96,3 +96,3 @@ break; | ||
log.info('Done.'); | ||
log.info('Target position of Curtain has been set to: ' + this.targetPosition + '%'); | ||
log.info("Target position of Curtain has been set to: " + this.targetPosition + "%"); | ||
this.moveTimer = setTimeout(() => { | ||
@@ -118,3 +118,3 @@ var _a, _b; | ||
}, 1000); | ||
log.info('Target position of Curtain failed to be set to: ' + this.targetPosition + '%'); | ||
log.info("Target position of Curtain failed to be set to: " + this.targetPosition + "%"); | ||
callback(); | ||
@@ -126,10 +126,10 @@ }); | ||
.on("get" /* GET */, (callback) => { | ||
log.info('The position state of Curtain was returned: ' + this.positionState); | ||
log.info("The position state of Curtain was returned: " + this.positionState); | ||
callback(undefined, this.positionState); | ||
}); | ||
this.informationService = new hap.Service.AccessoryInformation() | ||
.setCharacteristic(hap.Characteristic.Manufacturer, 'SwitchBot') | ||
.setCharacteristic(hap.Characteristic.Model, 'SWITCHBOT-CURTAIN-W0701600') | ||
.setCharacteristic(hap.Characteristic.Manufacturer, "SwitchBot") | ||
.setCharacteristic(hap.Characteristic.Model, "SWITCHBOT-CURTAIN-W0701600") | ||
.setCharacteristic(hap.Characteristic.SerialNumber, this.bleMac); | ||
log.info('Curtain \'%s\' created!', name); | ||
log.info("Curtain '%s' created!", name); | ||
} | ||
@@ -141,3 +141,3 @@ /* | ||
identify() { | ||
this.log.info('Identify!'); | ||
this.log.info("Identify!"); | ||
} | ||
@@ -144,0 +144,0 @@ /* |
@@ -16,7 +16,7 @@ "use strict"; | ||
.on("get" /* GET */, (callback) => { | ||
log.info(name + ' current temperature: ' + this.temperature + '\u2103'); | ||
log.info(name + " current temperature: " + this.temperature + "\u2103"); | ||
callback(undefined, (this.temperature < 0) ? 0 : (this.temperature > 100 ? 100 : this.temperature)); | ||
}) | ||
.on("set" /* SET */, (value, callback) => { | ||
log.info('The temperature of the Meter can\'t be set!'); | ||
log.info("The temperature of the Meter can't be set!"); | ||
callback(); | ||
@@ -27,14 +27,14 @@ }); | ||
.on("get" /* GET */, (callback) => { | ||
log.info(name + ' current humidity: ' + this.humidity + '%'); | ||
log.info(name + " current humidity: " + this.humidity + "%"); | ||
callback(undefined, this.humidity); | ||
}) | ||
.on("set" /* SET */, (value, callback) => { | ||
log.info('The humidity of the Meter can\'t be set!'); | ||
log.info("The humidity of the Meter can't be set!"); | ||
callback(); | ||
}); | ||
this.informationService = new hap.Service.AccessoryInformation() | ||
.setCharacteristic(hap.Characteristic.Manufacturer, 'SwitchBot') | ||
.setCharacteristic(hap.Characteristic.Model, 'SWITCHBOT-METERTH-S1') | ||
.setCharacteristic(hap.Characteristic.Manufacturer, "SwitchBot") | ||
.setCharacteristic(hap.Characteristic.Model, "SWITCHBOT-METERTH-S1") | ||
.setCharacteristic(hap.Characteristic.SerialNumber, this.bleMac); | ||
log.info(name, 'scanDuration:' + this.scanDuration.toString() + 'ms', 'scanInterval:' + this.scanInterval.toString() + 'ms'); | ||
log.info(name, "scanDuration:" + this.scanDuration.toString() + "ms", "scanInterval:" + this.scanInterval.toString() + "ms"); | ||
const Switchbot = require('node-switchbot'); | ||
@@ -78,3 +78,3 @@ const switchbot = new Switchbot(); | ||
identify() { | ||
this.log.info('Identify!'); | ||
this.log.info("Identify!"); | ||
} | ||
@@ -81,0 +81,0 @@ /* |
@@ -5,3 +5,3 @@ "use strict"; | ||
const meter_accessory_1 = require("./meter-accessory"); | ||
const PLATFORM_NAME = 'SwitchBotPlatform'; | ||
const PLATFORM_NAME = "SwitchBotPlatform"; | ||
/* | ||
@@ -31,7 +31,7 @@ * IMPORTANT NOTICE | ||
class SwitchBotPlatform { | ||
constructor(log, config, _api) { | ||
constructor(log, config, api) { | ||
this.log = log; | ||
// probably parse config or something here | ||
this.config = config; | ||
log.info('SwitchBot platform finished initializing!'); | ||
log.info("SwitchBot platform finished initializing!"); | ||
} | ||
@@ -45,5 +45,5 @@ /* | ||
accessories(callback) { | ||
const deviceList = []; | ||
let deviceList = []; | ||
if (this.config.devices) { | ||
for (const device of this.config.devices) { | ||
for (var device of this.config.devices) { | ||
// this.log.info(device.type); | ||
@@ -53,3 +53,3 @@ // this.log.info(device.name); | ||
// this.log.info(device.scanDuration, typeof device.scanDuration); | ||
const scanDuration = device.scanDuration || 1000; | ||
let scanDuration = device.scanDuration || 1000; | ||
switch (device.type) { | ||
@@ -79,3 +79,3 @@ case 'bot': | ||
} | ||
this.log('Device amount:', deviceList.length.toString()); | ||
this.log("Device amount:", deviceList.length.toString()); | ||
callback(deviceList); | ||
@@ -82,0 +82,0 @@ } |
{ | ||
"name": "@switchbot/homebridge-switchbot-ble", | ||
"version": "1.2.6", | ||
"version": "1.2.7", | ||
"description": "Homebridge integration for SwitchBot BLE series products", | ||
"license": "ISC", | ||
"files": [ | ||
"LICENSE", | ||
"dist", | ||
"config.schema.json" | ||
], | ||
"repository": { | ||
@@ -7,0 +12,0 @@ "type": "git", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
0
0
44643
12
502