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
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@

All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/)

## [Version 1.5.0](https://github.com/OpenWonderLabs/node-switchbot/releases/tag/v1.5.0) (2022-08-27)
## [Version 1.6.0](https://github.com/OpenWonderLabs/node-switchbot/releases/tag/v1.5.0) (2022-10-18)

## What's Changed

- Added Color Bulb & Strip Light Support
- Added Support for Pushing Changes to Color Bulb & Strip Light
- Housekeeping and update dependencies

**Full Changelog**: https://github.com/OpenWonderLabs/node-switchbot/compare/v1.5.0...v1.6.0

## [Version 1.5.0](https://github.com/OpenWonderLabs/node-switchbot/releases/tag/v1.5.0) (2022-10-07)

## What's Changed

- Added Support for receiving status updates from Color Bulb & Strip Light
- Fixed issue that caused excessive logging.
- Housekeeping and update dependencies

**Full Changelog**: https://github.com/OpenWonderLabs/node-switchbot/compare/v1.4.1...v1.5.0

Expand Down
20 changes: 10 additions & 10 deletions lib/parameter-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ParameterChecker {
* an `Error` object will be set to `this._error`.
*
* [Usage]
* let valid = parameterChecker.check(params, {
* const valid = parameterChecker.check(params, {
* level: {
* required: false,
* type: 'integer',
Expand All @@ -50,7 +50,7 @@ class ParameterChecker {
* }
* });
* if(!valid) {
* let e = parameterChecker.error.message;
* const e = parameterChecker.error.message;
* throw new Error(message);
* }
* ---------------------------------------------------------------- */
Expand Down Expand Up @@ -78,13 +78,13 @@ class ParameterChecker {
return false;
}

let result = true;
let name_list = Object.keys(rules);
const result = true;
const name_list = Object.keys(rules);

for (let i = 0; i < name_list.length; i++) {
let name = name_list[i];
let v = obj[name];
let rule = rules[name];
for (const i = 0; i < name_list.length; i++) {
const name = name_list[i];
const v = obj[name];
const rule = rules[name];

if (!rule) {
rule = {};
Expand Down Expand Up @@ -458,7 +458,7 @@ class ParameterChecker {
}
}
if (typeof rule.minBytes === "number") {
let blen = Buffer.from(value, "utf8").length;
const blen = Buffer.from(value, "utf8").length;
if (blen < rule.minBytes) {
this._error = {
code: "LENGTH_UNDERFLOW",
Expand All @@ -475,7 +475,7 @@ class ParameterChecker {
}
}
if (typeof rule.maxBytes === "number") {
let blen = Buffer.from(value, "utf8").length;
const blen = Buffer.from(value, "utf8").length;
if (blen > rule.maxBytes) {
this._error = {
code: "LENGTH_OVERFLOW",
Expand Down
Loading