homebridge-syntex-magichome
Advanced tools
Comparing version 1.2.5-b5 to 1.2.5-b6
{ | ||
"name": "homebridge-syntex-magichome", | ||
"version": "1.2.5-b5", | ||
"version": "1.2.5-b6", | ||
"description": "Homebridge Plugin for MagicHome LED Strips with preset scenes", | ||
@@ -15,3 +15,3 @@ "main": "index.js", | ||
"color-convert": "^1.5.0", | ||
"homebridge-syntex-dynamic-platform": "1.0.8-b52" | ||
"homebridge-syntex-dynamic-platform": "1.0.8-b57" | ||
}, | ||
@@ -18,0 +18,0 @@ "keywords": [ |
@@ -56,61 +56,2 @@ const { ColoredBulbService } = require('homebridge-syntex-dynamic-platform'); | ||
updateState(state) | ||
{ | ||
if(!this.running) | ||
{ | ||
var changed = false; | ||
if(state.value != null && !isNaN(state.value) && (!super.hasState('value') || this.value != state.value)) | ||
{ | ||
this.tempState.value = state.value; | ||
super.setState(state.value, | ||
() => this.service.getCharacteristic(this.Characteristic.On).updateValue(state.value), false); | ||
changed = true; | ||
} | ||
if(state.hue != null && !isNaN(state.hue) && (!super.hasState('hue') || this.hue != state.hue)) | ||
{ | ||
this.tempState.hue = state.hue; | ||
super.setHue(state.hue, | ||
() => this.service.getCharacteristic(this.Characteristic.Hue).updateValue(state.hue), false); | ||
changed = true; | ||
} | ||
if(state.saturation != null && !isNaN(state.saturation) && (!super.hasState('saturation') || this.saturation != state.saturation)) | ||
{ | ||
this.tempState.saturation = state.saturation; | ||
super.setSaturation(state.saturation, | ||
() => this.service.getCharacteristic(this.Characteristic.Saturation).updateValue(state.saturation), false); | ||
changed = true; | ||
} | ||
if(state.brightness != null && !isNaN(state.brightness) && (!super.hasState('brightness') || this.brightness != state.brightness)) | ||
{ | ||
this.tempState.brightness = state.brightness; | ||
super.setBrightness(state.brightness, | ||
() => this.service.getCharacteristic(this.Characteristic.Brightness).updateValue(state.brightness), false); | ||
changed = true; | ||
} | ||
if(changed) | ||
{ | ||
this.logger.log('update', this.id, this.letters, '%update_state[0]% [' + this.name + '] %update_state[1]% [' + this.getStateText() + '] ( ' + this.id + ' )'); | ||
} | ||
else | ||
{ | ||
this.logger.log('debug', this.id, this.letters, '%update_state[0]% [' + this.name + '] %update_state[2]%! ( ' + this.id + ' )'); | ||
} | ||
this.AutomationSystem.LogikEngine.runAutomation(this, { value : this.value, hue : this.hue, saturation : this.saturation, brightness : this.brightness }); | ||
} | ||
} | ||
getState(callback) | ||
@@ -262,2 +203,53 @@ { | ||
*/ | ||
updateState(state) | ||
{ | ||
if(!this.running) | ||
{ | ||
var changed = false; | ||
if(state.value != null && !isNaN(state.value) && (!super.hasState('value') || this.value != state.value)) | ||
{ | ||
super.setState(state.value, | ||
() => this.service.getCharacteristic(this.Characteristic.On).updateValue(state.value), false); | ||
changed = true; | ||
} | ||
if(state.hue != null && !isNaN(state.hue) && (!super.hasState('hue') || this.hue != state.hue)) | ||
{ | ||
super.setHue(state.hue, | ||
() => this.service.getCharacteristic(this.Characteristic.Hue).updateValue(state.hue), false); | ||
changed = true; | ||
} | ||
if(state.saturation != null && !isNaN(state.saturation) && (!super.hasState('saturation') || this.saturation != state.saturation)) | ||
{ | ||
super.setSaturation(state.saturation, | ||
() => this.service.getCharacteristic(this.Characteristic.Saturation).updateValue(state.saturation), false); | ||
changed = true; | ||
} | ||
if(state.brightness != null && !isNaN(state.brightness) && (!super.hasState('brightness') || this.brightness != state.brightness)) | ||
{ | ||
super.setBrightness(state.brightness, | ||
() => this.service.getCharacteristic(this.Characteristic.Brightness).updateValue(state.brightness), false); | ||
changed = true; | ||
} | ||
if(changed) | ||
{ | ||
this.logger.log('update', this.id, this.letters, '%update_state[0]% [' + this.name + '] %update_state[1]% [' + this.getStateText() + '] ( ' + this.id + ' )'); | ||
} | ||
else | ||
{ | ||
this.logger.log('debug', this.id, this.letters, '%update_state[0]% [' + this.name + '] %update_state[2]%! ( ' + this.id + ' )'); | ||
} | ||
this.AutomationSystem.LogikEngine.runAutomation(this, { value : this.value, hue : this.hue, saturation : this.saturation, brightness : this.brightness }); | ||
} | ||
} | ||
setToCurrentColor(state, callback) | ||
@@ -264,0 +256,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
119669
889
+ Addedhomebridge-syntex-dynamic-platform@1.0.8-b57(transitive)
- Removedhomebridge-syntex-dynamic-platform@1.0.8-b52(transitive)