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

homebridge-plugin-command-dev

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

homebridge-plugin-command-dev - npm Package Compare versions

Comparing version 1.0.12 to 1.0.13

26

index.js

@@ -1,5 +0,3 @@

const { exit } = require('process');
const { execSync } = require('child_process');
var exec = require('child_process').execSync;
module.exports = function (api) {

@@ -21,2 +19,3 @@ api.registerAccessory("homebridge-plugin-command", "commandAccessory", CommandAccessoryPlugin);

.setCharacteristic(this.api.hap.Characteristic.Manufacturer, "adyanth")
.setCharacteristic(this.api.hap.Characteristic.SerialNumber, "#007")
.setCharacteristic(this.api.hap.Characteristic.Model, config["name"]);

@@ -44,13 +43,18 @@

if (!this.config.check_status) {
this.log.debug(`No check_status, returning static state: ${this.currentState}`)
return this.currentState;
}
this.log.info(`Running check_status`);
this.log.debug(`Running: ${this.config.check_status}`);
let state = null;
try {
exec(this.config.check_status);
return !this.config.invert_status;
} catch (error) { }
execSync(this.config.check_status);
state = !this.config.invert_status;
} catch (error) {
state = false;
}
return false;
this.log.debug(`Returning: ${state}`);
return state;
}

@@ -61,6 +65,7 @@

let cmd = value ? this.config.turn_on : this.config.turn_off;
let exitCode = 1;
this.log.info(`Running ${value ? "turn_on" : "turn_off"}`);
this.log.debug(`Running: ${cmd}`);
try {
exec(value ? this.config.turn_on : this.config.turn_off);
execSync(cmd);
exitCode = 0;

@@ -73,4 +78,5 @@ } catch (error) {

this.currentState = value ^ (exitCode != 0);
this.log.debug(`Returning: ${this.currentState}}`);
return this.currentState;
}
}
{
"name": "homebridge-plugin-command-dev",
"version": "1.0.12",
"version": "1.0.13",
"description": "This Homebridge plugin enables you to create virtual switches that can run any custom command when it is turned on or off.",

@@ -5,0 +5,0 @@ "main": "index.js",

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