homebridge-syntex-magichome
Advanced tools
Comparing version 1.2.4-b8 to 1.2.4-b9
{ | ||
"name": "homebridge-syntex-magichome", | ||
"version": "1.2.4-b8", | ||
"version": "1.2.4-b9", | ||
"description": "Homebridge Plugin for MagicHome LED Strips with preset scenes", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -71,9 +71,4 @@ const { ColoredBulbService } = require('homebridge-syntex-dynamic-platform'); | ||
if(state.value != null && !isNaN(state.value)) | ||
if(state.value != null && !isNaN(state.value) && (!super.hasState('value') || this.value != state.value)) | ||
{ | ||
if(!super.hasState('value') || this.value != state.value) | ||
{ | ||
changed = true; | ||
} | ||
this.value = this.tempState.value = state.value; | ||
@@ -83,11 +78,8 @@ | ||
() => this.service.getCharacteristic(this.Characteristic.On).updateValue(state.value)); | ||
} | ||
if(state.hue != null && !isNaN(state.hue)) | ||
{ | ||
if(!super.hasState('hue') || this.hue != state.hue) | ||
{ | ||
changed = true; | ||
} | ||
if(state.hue != null && !isNaN(state.hue) && (!super.hasState('hue') || this.hue != state.hue)) | ||
{ | ||
this.hue = this.tempState.hue = state.hue; | ||
@@ -97,11 +89,8 @@ | ||
() => this.service.getCharacteristic(this.Characteristic.Hue).updateValue(state.hue)); | ||
} | ||
if(state.saturation != null && !isNaN(state.saturation)) | ||
{ | ||
if(!super.hasState('saturation') || this.saturation != state.saturation) | ||
{ | ||
changed = true; | ||
} | ||
if(state.saturation != null && !isNaN(state.saturation) && (!super.hasState('saturation') || this.saturation != state.saturation)) | ||
{ | ||
this.saturation = this.tempState.saturation = state.saturation; | ||
@@ -111,11 +100,8 @@ | ||
() => this.service.getCharacteristic(this.Characteristic.Saturation).updateValue(state.saturation)); | ||
} | ||
if(state.brightness != null && !isNaN(state.brightness)) | ||
{ | ||
if(!super.hasState('brightness') || this.brightness != state.brightness) | ||
{ | ||
changed = true; | ||
} | ||
if(state.brightness != null && !isNaN(state.brightness) && (!super.hasState('brightness') || this.brightness != state.brightness)) | ||
{ | ||
this.brightness = this.tempState.brightness = state.brightness; | ||
@@ -125,2 +111,4 @@ | ||
() => this.service.getCharacteristic(this.Characteristic.Brightness).updateValue(state.brightness)); | ||
changed = true; | ||
} | ||
@@ -419,3 +407,3 @@ | ||
}, (resolve) => { | ||
if(callback != null) | ||
@@ -422,0 +410,0 @@ { |
@@ -60,4 +60,8 @@ const cp = require('child_process'), path = require('path'), convert = require('color-convert'); | ||
accessory[1].service[parseInt(i) + 1].setConnectionState(state.connection, | ||
() => accessory[1].service[parseInt(i) + 1].updateState(state), true); | ||
if(accessory[1].service[parseInt(i) + 1].setConnectionState != null | ||
&& accessory[1].service[parseInt(i) + 1].updateState != null) | ||
{ | ||
accessory[1].service[parseInt(i) + 1].setConnectionState(state.connection, | ||
() => accessory[1].service[parseInt(i) + 1].updateState(state), true); | ||
} | ||
}); | ||
@@ -73,4 +77,8 @@ } | ||
accessory[1].service[1].setConnectionState(state.connection, | ||
() => accessory[1].service[1].updateState(state), true); | ||
if(accessory[1].service[1].setConnectionState != null | ||
&& accessory[1].service[1].updateState != null) | ||
{ | ||
accessory[1].service[1].setConnectionState(state.connection, | ||
() => accessory[1].service[1].updateState(state), true); | ||
} | ||
}); | ||
@@ -77,0 +85,0 @@ } |
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
120416
889