Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
goedh452 authored Jun 23, 2019
1 parent c3bf9ac commit 4c41260
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ HttpSprinkler.prototype = {


setDurationTime: function(data, callback) {
console.log("Valve Time Duration Set to: " + data.newValue + " seconds")
this.log("Valve Time Duration Set to: " + data.newValue + " seconds")

if (this.valveService.getCharacteristic(Characteristic.InUse).value) {
this.valveService.getCharacteristic(Characteristic.RemainingDuration).updateValue(data.newValue);
Expand All @@ -223,7 +223,7 @@ HttpSprinkler.prototype = {
clearTimeout(this.valveService.timer);

this.valveService.timer = setTimeout(() => {
console.log("Valve Timer Expired. Shutting off Valve");
this.log("Valve Timer Expired. Shutting off Valve");
// use 'setvalue' when the timer ends so it triggers the .on('set'...) event
this.valveService.getCharacteristic(Characteristic.Active).setValue(0);
}, (data.newValue * 1000));
Expand All @@ -246,10 +246,10 @@ HttpSprinkler.prototype = {
this.valveService.getCharacteristic(Characteristic.RemainingDuration)
.updateValue(timer);

console.log("Turning Valve " + this.name + " on with Timer set to: " + timer + " seconds");
this.log("Turning Valve " + this.name + " on with Timer set to: " + timer + " seconds");

this.valveService.timer = setTimeout(() => {
console.log("Valve Timer Expired. Shutting off Valve");
this.log("Valve Timer Expired. Shutting off Valve");

// use 'setvalue' when the timer ends so it triggers the .on('set'...) event
this.valveService.getCharacteristic(Characteristic.Active).setValue(0);
Expand Down Expand Up @@ -328,7 +328,7 @@ HttpSprinkler.prototype = {

this.valveService.getCharacteristic(Characteristic.RemainingDuration)
.on('change', (data) => {
console.log("Valve Remaining Duration changed to: " + data.newValue)
this.log("Valve Remaining Duration changed to: " + data.newValue)
})

this.valveService.getCharacteristic(Characteristic.InUse)
Expand Down

0 comments on commit 4c41260

Please sign in to comment.