homebridge-delay-switch
Advanced tools
Comparing version 0.0.1 to 0.1.0
10
index.js
@@ -17,3 +17,3 @@ "use strict"; | ||
this.delayTime = config.delay; | ||
this.Timer; | ||
this._service = new Service.Switch(this.name); | ||
@@ -31,8 +31,12 @@ this._service.getCharacteristic(Characteristic.On) | ||
if (on) { | ||
setTimeout(function() { | ||
clearTimeout(this.Timer); | ||
this.Timer = setTimeout(function() { | ||
this._service.setCharacteristic(Characteristic.On, false); | ||
}.bind(this), this.delayTime); | ||
} | ||
else { | ||
clearTimeout(this.Timer); | ||
} | ||
callback(); | ||
} | ||
} |
{ | ||
"name": "homebridge-delay-switch", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "Delay switches for Homebridge: https://github.com/nfarina/homebridge", | ||
@@ -21,2 +21,2 @@ "license": "ISC", | ||
} | ||
} | ||
} |
@@ -38,4 +38,4 @@ | ||
```sudo npm install -g homebridge-delay-switch``` | ||
## Credits | ||
This plugin was forked from and inspired by homebridge-dummy by @nfarina | ||
This plugin was forked from and inspired by homebridge-dummy by @nfarina |
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
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
3196
32
41