homebridge-lg-airco
Advanced tools
Comparing version 0.0.997 to 0.0.998
{ | ||
"name": "homebridge-lg-airco", | ||
"version": "0.0.997", | ||
"version": "0.0.998", | ||
"description": "Homebridge plugin to control a Smart Thinq enabled LG airco unit. Makes use of WideQ => https://github.com/sampsyo/wideq", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -73,3 +73,3 @@ const Wideq = require("./lg/wideq").Wideq; | ||
console.log(this.state); | ||
//console.log(this.state); | ||
@@ -96,3 +96,3 @@ this.getActive((unknown, value) => { | ||
if (this.state.isOn) { | ||
console.log('setting fast interval'); | ||
console.log('Setting fast as status interval'); | ||
this.intervalWhenOn = setInterval(() => { | ||
@@ -102,3 +102,3 @@ this.updateState() | ||
} else { | ||
console.log('setting slow interval'); | ||
console.log('Setting slow ac status interval'); | ||
this.intervalWhenOff = setInterval(() => { | ||
@@ -122,10 +122,8 @@ this.updateState(); | ||
if (shouldBeActive !== (me.state.isOn ? 1 : 0)) { | ||
const isOn = shouldBeActive === Characteristic.Active.ACTIVE; | ||
console.log('Turning ac ' + (isOn ? 'on' : 'off') + '!'); | ||
me.wideq.turnOnOrOff(me.deviceId, isOn) | ||
const turnOnOrOff = shouldBeActive === Characteristic.Active.ACTIVE; | ||
if (me.state.isOn !== turnOnOrOff) { | ||
console.log('Turning ac ' + (turnOnOrOff ? 'on' : 'off') + '!'); | ||
me.wideq.turnOnOrOff(me.deviceId, turnOnOrOff) | ||
.then((done) => { | ||
me.state.isOn = isOn; | ||
me.state.isOn = turnOnOrOff; | ||
me.setCorrectInterval(); | ||
@@ -170,11 +168,15 @@ }); | ||
let turnOn = false; | ||
let turnOnOrOff = false; | ||
if (targetState !== Characteristic.TargetHeaterCoolerState.AUTO) { | ||
turnOn = true; | ||
turnOnOrOff = true; | ||
} | ||
me.wideq.turnOnOrOff(me.deviceId, turnOn).then((done) => { | ||
me.state.isOn = turnOn; | ||
me.state.isOn = turnOn; | ||
}); | ||
if(me.state.isOn !== turnOnOrOff) { | ||
console.log('Turning ac ' + (turnOnOrOff ? 'on' : 'off') + '!'); | ||
me.wideq.turnOnOrOff(me.deviceId, turnOnOrOff) | ||
.then((done) => { | ||
me.state.isOn = turnOnOrOff; | ||
me.setCorrectInterval(); | ||
}); | ||
} | ||
@@ -181,0 +183,0 @@ callback(null); |
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
106079
423