New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

homebridge-tuya-outlet

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

homebridge-tuya-outlet - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

28

index.js
const tuya = require('tuyapi');
const debug = require('debug')('homebridge-tuya');

@@ -13,3 +14,9 @@ module.exports = function(homebridge) {

this.name = config.name;
this.tuya = new tuya({type: 'outlet', ip: config.ip, id: config.devId, uid: config.uid, key: config.localKey});
if (config.ip != undefined) {
this.tuya = new tuya({type: 'outlet', ip: config.ip, id: config.devId, key: config.localKey});
}
else {
this.tuya = new tuya({type: 'outlet', id: config.devId, key: config.localKey});
this.tuya.resolveIds();
}

@@ -22,6 +29,8 @@ this._service = new Service.Outlet(this.name);

TuyaOutlet.prototype._setOn = function(on, callback) {
this.log("Setting device to " + on);
this.tuya.setStatus(on, (error, result) => {
if (error) { return callback(error, null); }
debug("Setting device to " + on);
this.tuya.set({set: on}).then(() => {
return callback(null, true);
}).catch(error => {
return callback(error, null);
});

@@ -31,6 +40,7 @@ }

TuyaOutlet.prototype._get = function(callback) {
this.log("Getting device status...");
this.tuya.getStatus((error, result) => {
if (error) { return callback(error, null); }
return callback(null, result);
debug("Getting device status...");
this.tuya.get().then(status => {
return callback(null, status);
}).catch(error => {
callback(error, null);
});

@@ -44,4 +54,4 @@ }

TuyaOutlet.prototype.identify = function (callback) {
this.log(_this.config.name + " was identified.");
debug(_this.config.name + " was identified.");
callback();
};
{
"name": "homebridge-tuya-outlet",
"version": "1.0.1",
"version": "1.1.0",
"description": "Homebridge plugin for devices utilizing Tuya's API: https://github.com/codetheweb/homebridge-tuya-outlet",

@@ -23,4 +23,5 @@ "license": "MIT",

"dependencies": {
"tuyapi": "^1.1.0"
"debug": "^3.1.0",
"tuyapi": "^2.0.0"
}
}
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