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

homebridge-delay-switch

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

homebridge-delay-switch - npm Package Compare versions

Comparing version 3.0.4 to 3.1.0

7

config.schema.json

@@ -48,2 +48,9 @@ {

"required": false
},
"debug": {
"title": "Enable Debug Logs",
"description": "When checked, the plugin will produce extra logs for debugging purposes",
"type": "boolean",
"default": false,
"required": false
}

@@ -50,0 +57,0 @@ }

25

index.js

@@ -18,2 +18,3 @@

this.delay = config['delay'];
this.debug = config.debug || false
this.sensorType = config['sensorType'];

@@ -29,2 +30,14 @@ if (typeof this.sensorType === 'undefined')

this.uuid = UUIDGen.generate(this.name)
// define debug method to output debug logs when enabled in the config
this.log.easyDebug = (...content) => {
if (this.debug) {
this.log(content.reduce((previous, current) => {
return previous + ' ' + current
}))
} else
this.log.debug(content.reduce((previous, current) => {
return previous + ' ' + current
}))
}

@@ -74,2 +87,6 @@ this.getSensorState = () => {

break;
case 'leak':
this.sensorService = new Service.LeakSensor(this.name + ' Trigger');
this.sensorCharacteristic = Characteristic.LeakDetected
break;
default:

@@ -98,3 +115,3 @@ this.sensorService = new Service.MotionSensor(this.name + ' Trigger');

if (!on) {
this.log('Stopping the Timer');
this.log.easyDebug('Stopping the Timer');

@@ -108,3 +125,3 @@ this.switchOn = false;

} else {
this.log('Starting the Timer');
this.log.easyDebug('Starting the Timer');
this.switchOn = true;

@@ -114,3 +131,3 @@

this.timer = setTimeout(function() {
this.log('Time is Up!');
this.log.easyDebug('Time is Up!');
this.switchService.getCharacteristic(Characteristic.On).updateValue(false);

@@ -122,3 +139,3 @@ this.switchOn = false;

this.sensorService.getCharacteristic(this.sensorCharacteristic).updateValue(this.getSensorState());
this.log('Triggering Sensor');
this.log.easyDebug('Triggering Sensor');
setTimeout(function() {

@@ -125,0 +142,0 @@ this.sensorTriggered = 0;

2

package.json
{
"name": "homebridge-delay-switch",
"version": "3.0.4",
"version": "3.1.0",
"description": "Delay switches for Homebridge",

@@ -5,0 +5,0 @@ "license": "MIT",

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