Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-switchbot

Package Overview
Dependencies
Maintainers
2
Versions
298
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-switchbot - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3-beta.0

53

lib/switchbot-device-wohumi.js

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc