diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e7716c8..a6933d86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -121,7 +121,7 @@ All notable changes to this project will be documented in this file. This projec ### What's Changed -- Fix Plug Mini (US) implimentation +- Fix Plug Mini (US) implementation - Housekeeping and update dependencies **Full Changelog**: https://github.com/OpenWonderLabs/node-switchbot/compare/v1.4.0...v1.4.1 diff --git a/README.md b/README.md index 0cff1190..b29eaa50 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ But some functionalities of this module were developed through trial and error. - [Moving the arm of the Bot](#moving-the-arm-of-the-bot) - [`Switchbot` object](#switchbot-object) - [`discover()` method](#discover-method) - - [`ondiscover` event handler](#ondiscover-event-hander) + - [`ondiscover` event handler](#ondiscover-event-handler) - [`startScan()` method](#startscan-method) - [`stopScan()` method](#stopscan-method) - [`onadvertisement` event handler](#onadvertisement-event-handler) @@ -117,7 +117,7 @@ const switchbot = new Switchbot(); (async () => { // Start to monitor advertisement packets await switchbot.startScan(); - // Set an event hander + // Set an event handler switchbot.onadvertisement = (ad) => { console.log(JSON.stringify(ad, null, ' ')); }; @@ -145,7 +145,7 @@ const switchbot = new Switchbot(); switchbot .startScan() .then(() => { - // Set an event hander + // Set an event handler switchbot.onadvertisement = (ad) => { console.log(JSON.stringify(ad, null, " ")); }; diff --git a/src/device.ts b/src/device.ts index a47caa68..25ef7743 100644 --- a/src/device.ts +++ b/src/device.ts @@ -520,7 +520,7 @@ export class SwitchbotDevice { reject('READ_TIMEOUT'); }, this._READ_TIMEOUT_MSEC); - // Read charcteristic data + // Read characteristic data char.read((error, buf) => { if (timer) { clearTimeout(timer); @@ -543,7 +543,7 @@ export class SwitchbotDevice { reject('WRITE_TIMEOUT'); }, this._WRITE_TIMEOUT_MSEC); - // write charcteristic data + // write characteristic data char.write(buf, false, (error) => { if (timer) { clearTimeout(timer); diff --git a/src/device/woblindtilt.ts b/src/device/woblindtilt.ts index a6778e40..58a8e38c 100644 --- a/src/device/woblindtilt.ts +++ b/src/device/woblindtilt.ts @@ -68,7 +68,7 @@ export class WoBlindTilt extends SwitchbotDevice { return new Promise((resolve, reject) => { reject( new Error( - 'The type of target position percentage is incorrent: ' + + 'The type of target position percentage is incorrect: ' + typeof percent, ), ); @@ -80,7 +80,7 @@ export class WoBlindTilt extends SwitchbotDevice { if (typeof mode !== 'number') { return new Promise((resolve, reject) => { reject( - new Error('The type of running mode is incorrent: ' + typeof mode), + new Error('The type of running mode is incorrect: ' + typeof mode), ); }); } diff --git a/src/device/wobulb.ts b/src/device/wobulb.ts index e9492a30..8910ff23 100644 --- a/src/device/wobulb.ts +++ b/src/device/wobulb.ts @@ -47,7 +47,7 @@ export class WoBulb extends SwitchbotDevice { return new Promise((resolve, reject) => { reject( new Error( - 'The type of target brightness percentage is incorrent: ' + + 'The type of target brightness percentage is incorrect: ' + typeof brightness, ), ); @@ -69,7 +69,7 @@ export class WoBulb extends SwitchbotDevice { return new Promise((resolve, reject) => { reject( new Error( - 'The type of target color_temperature percentage is incorrent: ' + + 'The type of target color_temperature percentage is incorrect: ' + typeof color_temperature, ), ); @@ -91,7 +91,7 @@ export class WoBulb extends SwitchbotDevice { return new Promise((resolve, reject) => { reject( new Error( - 'The type of target brightness percentage is incorrent: ' + + 'The type of target brightness percentage is incorrect: ' + typeof brightness, ), ); @@ -101,7 +101,7 @@ export class WoBulb extends SwitchbotDevice { return new Promise((resolve, reject) => { reject( new Error( - 'The type of target red is incorrent: ' + + 'The type of target red is incorrect: ' + typeof red, ), ); @@ -111,7 +111,7 @@ export class WoBulb extends SwitchbotDevice { return new Promise((resolve, reject) => { reject( new Error( - 'The type of target green is incorrent: ' + + 'The type of target green is incorrect: ' + typeof green, ), ); @@ -121,7 +121,7 @@ export class WoBulb extends SwitchbotDevice { return new Promise((resolve, reject) => { reject( new Error( - 'The type of target blue is incorrent: ' + + 'The type of target blue is incorrect: ' + typeof blue, ), ); diff --git a/src/device/wocurtain.ts b/src/device/wocurtain.ts index f2b055ed..6b15a524 100644 --- a/src/device/wocurtain.ts +++ b/src/device/wocurtain.ts @@ -12,7 +12,7 @@ export class WoCurtain extends SwitchbotDevice { * - Open the curtain * * [Arguments] - * - mode | number | Opetional | runing mode (0x01 = QuietDrift, 0xff = Default) + * - mode | number | Optional | runing mode (0x01 = QuietDrift, 0xff = Default) * * [Return value] * - Promise object @@ -27,7 +27,7 @@ export class WoCurtain extends SwitchbotDevice { * - close the curtain * * [Arguments] - * - mode | number | Opetional | runing mode (0x01 = QuietDrift, 0xff = Default) + * - mode | number | Optional | runing mode (0x01 = QuietDrift, 0xff = Default) * * [Return value] * - Promise object @@ -58,7 +58,7 @@ export class WoCurtain extends SwitchbotDevice { * * [Arguments] * - percent | number | Required | the percentage of target position - * - mode | number | Opetional | runing mode (0x01 = QuietDrift, 0xff = Default) + * - mode | number | Optional | runing mode (0x01 = QuietDrift, 0xff = Default) * * [Return value] * - Promise object diff --git a/src/device/wostrip.ts b/src/device/wostrip.ts index dd131cbf..d0b4e237 100644 --- a/src/device/wostrip.ts +++ b/src/device/wostrip.ts @@ -43,7 +43,7 @@ export class WoStrip extends SwitchbotDevice { return new Promise((resolve, reject) => { reject( new Error( - 'The type of target brightness percentage is incorrent: ' + + 'The type of target brightness percentage is incorrect: ' + typeof brightness, ), ); @@ -81,7 +81,7 @@ export class WoStrip extends SwitchbotDevice { return new Promise((resolve, reject) => { reject( new Error( - 'The type of target brightness percentage is incorrent: ' + + 'The type of target brightness percentage is incorrect: ' + typeof brightness, ), ); @@ -91,7 +91,7 @@ export class WoStrip extends SwitchbotDevice { return new Promise((resolve, reject) => { reject( new Error( - 'The type of target red is incorrent: ' + + 'The type of target red is incorrect: ' + typeof red, ), ); @@ -101,7 +101,7 @@ export class WoStrip extends SwitchbotDevice { return new Promise((resolve, reject) => { reject( new Error( - 'The type of target green is incorrent: ' + + 'The type of target green is incorrect: ' + typeof green, ), ); @@ -111,7 +111,7 @@ export class WoStrip extends SwitchbotDevice { return new Promise((resolve, reject) => { reject( new Error( - 'The type of target blue is incorrent: ' + + 'The type of target blue is incorrect: ' + typeof blue, ), ); diff --git a/src/parameter-checker.ts b/src/parameter-checker.ts index 81770ae5..baf94db9 100644 --- a/src/parameter-checker.ts +++ b/src/parameter-checker.ts @@ -41,7 +41,7 @@ export class ParameterChecker { * [Arguments] * - obj | Object | Required | Object including parameters you want to check * - rules | Object | Required | Object including rules for the parameters - * - required | Boolean | Optional | Flag whther the `obj` is required or not. + * - required | Boolean | Optional | Flag whether the `obj` is required or not. * | | | The default is `false` * * [Return value] diff --git a/src/switchbot.ts b/src/switchbot.ts index c7de78fd..61fea801 100644 --- a/src/switchbot.ts +++ b/src/switchbot.ts @@ -249,7 +249,7 @@ export class SwitchBot { return; default: err = new Error( - 'Uknown state: ' + this.noble.state, + 'Unknown state: ' + this.noble.state, ); reject(err); return;