node-switchbot
Advanced tools
Comparing version 1.1.2 to 1.1.3-beta.0
@@ -7,4 +7,4 @@ 'use strict'; | ||
/* ------------------------------------------------------------------ | ||
* press() | ||
* - Press | ||
* Auto() | ||
* - Set Mode to Auto | ||
* | ||
@@ -18,9 +18,9 @@ * [Arguments] | ||
* ---------------------------------------------------------------- */ | ||
press() { | ||
return this._operateBot([0x57, 0x01, 0x00]); | ||
Auto() { | ||
return this._operateHumi([0x57, 0x01, 0x80]); | ||
} | ||
/* ------------------------------------------------------------------ | ||
* turnOn() | ||
* - Turn on | ||
* First() | ||
* - Set Mode to First | ||
* | ||
@@ -34,9 +34,9 @@ * [Arguments] | ||
* ---------------------------------------------------------------- */ | ||
turnOn() { | ||
return this._operateBot([0x57, 0x01, 0x01]); | ||
First() { | ||
return this._operateHumi([0x57, 0x01, 0x65]); | ||
} | ||
/* ------------------------------------------------------------------ | ||
* turnOff() | ||
* - Turn off | ||
* Second() | ||
* - Set Mode to Second | ||
* | ||
@@ -50,9 +50,9 @@ * [Arguments] | ||
* ---------------------------------------------------------------- */ | ||
turnOff() { | ||
return this._operateBot([0x57, 0x01, 0x02]); | ||
Second() { | ||
return this._operateHumi([0x57, 0x01, 0x66]); | ||
} | ||
/* ------------------------------------------------------------------ | ||
* down() | ||
* - Down | ||
* Third() | ||
* - Set Mode to Third | ||
* | ||
@@ -66,4 +66,4 @@ * [Arguments] | ||
* ---------------------------------------------------------------- */ | ||
down() { | ||
return this._operateBot([0x57, 0x01, 0x03]); | ||
Third() { | ||
return this._operateHumi([0x57, 0x01, 0x67]); | ||
} | ||
@@ -82,7 +82,22 @@ | ||
* ---------------------------------------------------------------- */ | ||
up() { | ||
return this._operateBot([0x57, 0x01, 0x04]); | ||
percentage() { | ||
return this._operateHumi([0x57, 0x01, 0x01]); | ||
} | ||
_operateBot(bytes) { | ||
/* ------------------------------------------------------------------ | ||
* turnOff() | ||
* - Turn off | ||
* | ||
* [Arguments] | ||
* - none | ||
* | ||
* [Returen value] | ||
* - Promise object | ||
* Nothing will be passed to the `resolve()`. | ||
* ---------------------------------------------------------------- */ | ||
turnOff() { | ||
return this._operateHumi([0x57, 0x01, 0x02]); | ||
} | ||
_operateHumi(bytes) { | ||
return new Promise((resolve, reject) => { | ||
@@ -89,0 +104,0 @@ let req_buf = Buffer.from(bytes); |
{ | ||
"name": "node-switchbot", | ||
"version": "1.1.2", | ||
"description": "The node-switchbot is a Node.js module which allows you to move your Switchbot (Bot)'s arm and Switchbot Curtain(Curtain), also monitor the temperature/humidity from SwitchBot Thermometer & Hygrometer (Meter).", | ||
"main": "./lib/switchbot.js", | ||
"files": [ | ||
"lib" | ||
], | ||
"directories": { | ||
"lib": "./lib" | ||
}, | ||
"scripts": { | ||
"check": "npm install && npm outdated", | ||
"update": "ncu -u && npm update && npm install" | ||
}, | ||
"keywords": [ | ||
"switchbot", | ||
"bot", | ||
"meter", | ||
"temperature", | ||
"humidity", | ||
"curtain", | ||
"BLE", | ||
"Bluetooth Low Energy", | ||
"Bluetooth smart", | ||
"Bluetooth" | ||
], | ||
"homepage": "https://github.com/OpenWonderLabs", | ||
"author": "OpenWonderLabs (https://github.com/OpenWonderLabs)", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/OpenWonderLabs/node-switchbot.git" | ||
}, | ||
"readmeFilename": "README.md", | ||
"dependencies": { | ||
"@abandonware/noble": "^1.9.2-15" | ||
}, | ||
"devDependencies": { | ||
"npm-check-updates": "^12.0.2" | ||
} | ||
"name": "node-switchbot", | ||
"version": "1.1.3-beta.0", | ||
"description": "The node-switchbot is a Node.js module which allows you to move your Switchbot (Bot)'s arm and Switchbot Curtain(Curtain), also monitor the temperature/humidity from SwitchBot Thermometer & Hygrometer (Meter).", | ||
"main": "./lib/switchbot.js", | ||
"files": [ | ||
"lib" | ||
], | ||
"directories": { | ||
"lib": "./lib" | ||
}, | ||
"scripts": { | ||
"check": "npm install && npm outdated", | ||
"update": "ncu -u && npm update && npm install" | ||
}, | ||
"keywords": [ | ||
"switchbot", | ||
"bot", | ||
"meter", | ||
"temperature", | ||
"humidity", | ||
"curtain", | ||
"BLE", | ||
"Bluetooth Low Energy", | ||
"Bluetooth smart", | ||
"Bluetooth" | ||
], | ||
"homepage": "https://github.com/OpenWonderLabs", | ||
"author": "OpenWonderLabs (https://github.com/OpenWonderLabs)", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/OpenWonderLabs/node-switchbot.git" | ||
}, | ||
"readmeFilename": "README.md", | ||
"dependencies": { | ||
"@abandonware/noble": "^1.9.2-15" | ||
}, | ||
"devDependencies": { | ||
"npm-check-updates": "^12.0.2" | ||
} | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
102303
1756
1