Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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, ' '));
};
Expand Down Expand Up @@ -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, " "));
};
Expand Down
4 changes: 2 additions & 2 deletions src/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/device/woblindtilt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
);
Expand All @@ -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),
);
});
}
Expand Down
12 changes: 6 additions & 6 deletions src/device/wobulb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
);
Expand All @@ -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,
),
);
Expand All @@ -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,
),
);
Expand All @@ -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,
),
);
Expand All @@ -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,
),
);
Expand All @@ -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,
),
);
Expand Down
6 changes: 3 additions & 3 deletions src/device/wocurtain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/device/wostrip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
);
Expand Down Expand Up @@ -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,
),
);
Expand All @@ -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,
),
);
Expand All @@ -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,
),
);
Expand All @@ -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,
),
);
Expand Down
2 changes: 1 addition & 1 deletion src/parameter-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/switchbot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down