homebridge-syntex-webhooks
Advanced tools
Comparing version 2.3.8-b2 to 2.3.8-b20
{ | ||
"name": "homebridge-syntex-webhooks", | ||
"version": "2.3.8-b2", | ||
"version": "2.3.8-b20", | ||
"description": "A webhook plugin for HTTP devices", | ||
@@ -16,3 +16,3 @@ "main": "index.js", | ||
"color-convert": "^1.5.0", | ||
"homebridge-syntex-dynamic-platform": "1.0.8-b8", | ||
"homebridge-syntex-dynamic-platform": "1.0.8-b26", | ||
"json-fs-store": "^1.0.1" | ||
@@ -43,4 +43,5 @@ }, | ||
"devDependencies": { | ||
"eslint": "^8.7.0" | ||
"eslint": "^8.7.0", | ||
"eslint-plugin-react": "^7.31.11" | ||
} | ||
} |
@@ -17,25 +17,6 @@ const { ColoredBulbService } = require('homebridge-syntex-dynamic-platform'); | ||
if(state.value != null) | ||
{ | ||
super.setState(state.value, | ||
() => this.service.getCharacteristic(this.Characteristic.On).updateValue(state.value)); | ||
} | ||
if(state.hue != null) | ||
{ | ||
super.setHue(state.hue, | ||
() => this.service.getCharacteristic(this.Characteristic.Hue).updateValue(state.hue)); | ||
} | ||
if(state.saturation != null) | ||
{ | ||
super.setSaturation(state.saturation, | ||
() => this.service.getCharacteristic(this.Characteristic.Saturation).updateValue(state.saturation)); | ||
} | ||
if(state.brightness != null) | ||
{ | ||
super.setBrightness(state.brightness, | ||
() => this.service.getCharacteristic(this.Characteristic.Brightness).updateValue(state.brightness)); | ||
} | ||
this.service.getCharacteristic(this.Characteristic.On).updateValue(this.value); | ||
this.service.getCharacteristic(this.Characteristic.Hue).updateValue(this.hue); | ||
this.service.getCharacteristic(this.Characteristic.Saturation).updateValue(this.saturation); | ||
this.service.getCharacteristic(this.Characteristic.Brightness).updateValue(this.brightness); | ||
}); | ||
@@ -52,3 +33,3 @@ }; | ||
{ | ||
this.setToCurrentColor({ value }, () => super.setState(value, () => callback())); | ||
this.setToCurrentColor({ value }, () => callback()); | ||
} | ||
@@ -63,3 +44,3 @@ | ||
{ | ||
this.setToCurrentColor({ hue }, () => super.setHue(hue, () => callback())); | ||
this.setToCurrentColor({ hue }, () => callback()); | ||
} | ||
@@ -74,3 +55,3 @@ | ||
{ | ||
this.setToCurrentColor({ saturation }, () => super.setSaturation(saturation, () => callback())); | ||
this.setToCurrentColor({ saturation }, () => callback()); | ||
} | ||
@@ -85,3 +66,3 @@ | ||
{ | ||
this.setToCurrentColor({ brightness }, () => super.setBrightness(brightness, () => callback())); | ||
this.setToCurrentColor({ brightness }, () => callback()); | ||
} | ||
@@ -93,9 +74,19 @@ | ||
this.DeviceManager.fetchRequests(this, { value : this.value, hue : this.hue, saturation : this.saturation, brightness : this.brightness }).then((success) => { | ||
this.DeviceManager.fetchRequests(this, { value : this.tempState.value, hue : this.tempState.hue, saturation : this.tempState.saturation, brightness : this.tempState.brightness }).then((success) => { | ||
if(success) | ||
{ | ||
this.value = this.tempState.value; | ||
this.hue = this.tempState.hue; | ||
this.saturation = this.tempState.saturation; | ||
this.brightness = this.tempState.brightness; | ||
super.setState(this.value, () => {}); | ||
super.setHue(this.hue, () => {}); | ||
super.setSaturation(this.saturation, () => {}); | ||
super.setBrightness(this.brightness, () => {}); | ||
this.logger.log('update', this.id, this.letters, '%update_state[0]% [' + this.name + '] %update_state[1]% [value: ' + this.value + ', hue: ' + this.hue + ', saturation: ' + this.saturation + ', brightness: ' + this.brightness + '] ( ' + this.id + ' )'); | ||
} | ||
if(callback != null) | ||
@@ -105,4 +96,6 @@ { | ||
} | ||
resolve(); | ||
resolve(); | ||
this.AutomationSystem.LogikEngine.runAutomation(this, { value : this.value, hue : this.hue, saturation : this.saturation, brightness : this.brightness }); | ||
}); | ||
@@ -109,0 +102,0 @@ }; |
@@ -15,15 +15,4 @@ const { DimmedBulbService } = require('homebridge-syntex-dynamic-platform'); | ||
if(state.value != null) | ||
{ | ||
super.setState(state.value, | ||
() => this.service.getCharacteristic(this.Characteristic.On).updateValue(state.value)); | ||
} | ||
if(state.brightness != null) | ||
{ | ||
super.setBrightness(state.brightness, | ||
() => this.service.getCharacteristic(this.Characteristic.Brightness).updateValue(state.brightness)); | ||
} | ||
this.AutomationSystem.LogikEngine.runAutomation(this, state); | ||
this.service.getCharacteristic(this.Characteristic.On).updateValue(this.value); | ||
this.service.getCharacteristic(this.Characteristic.Brightness).updateValue(this.brightness); | ||
}); | ||
@@ -40,8 +29,3 @@ }; | ||
{ | ||
this.setToCurrentBrightness({ value }, () => { | ||
super.setState(value, () => callback()); | ||
this.AutomationSystem.LogikEngine.runAutomation(this, { value, brightness : this.brightness }); | ||
}); | ||
this.setToCurrentBrightness({ value }, () => callback()); | ||
} | ||
@@ -56,8 +40,3 @@ | ||
{ | ||
this.setToCurrentBrightness({ brightness }, () => { | ||
super.setBrightness(brightness, () => callback()); | ||
this.AutomationSystem.LogikEngine.runAutomation(this, { value : this.value, brightness }); | ||
}); | ||
this.setToCurrentBrightness({ brightness }, () => callback()); | ||
} | ||
@@ -69,6 +48,12 @@ | ||
this.DeviceManager.fetchRequests(this, { value : this.value, brightness : this.brightness }).then((success) => { | ||
this.DeviceManager.fetchRequests(this, { value : this.tempState.value, brightness : this.tempState.brightness }).then((success) => { | ||
if(success) | ||
{ | ||
this.value = this.tempState.value; | ||
this.brightness = this.tempState.brightness; | ||
super.setState(this.value, () => {}); | ||
super.setBrightness(this.brightness, () => {}); | ||
this.logger.log('update', this.id, this.letters, '%update_state[0]% [' + this.name + '] %update_state[1]% [value: ' + this.value + ', brightness: ' + this.brightness + '] ( ' + this.id + ' )'); | ||
@@ -83,2 +68,4 @@ } | ||
resolve(); | ||
this.AutomationSystem.LogikEngine.runAutomation(this, { value : this.value, brightness : this.brightness }); | ||
}); | ||
@@ -85,0 +72,0 @@ }; |
55669
2
1033
+ Addedcharenc@0.0.2(transitive)
+ Addedcrypt@0.0.2(transitive)
+ Addedhomebridge-syntex-dynamic-platform@1.0.8-b26(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedmd5@2.3.0(transitive)
+ Addedsyntex-automation@1.2.1-b8(transitive)
+ Addedsyntex-basic@1.0.0-b10(transitive)
+ Addedsyntex-filesystem@1.0.3-b8(transitive)
+ Addedsyntex-logger@1.0.9-b2(transitive)
+ Addedsyntex-webserver@1.1.1-b4(transitive)
- Removedhomebridge-syntex-dynamic-platform@1.0.8-b8(transitive)
- Removedsyntex-automation@1.2.0(transitive)
- Removedsyntex-filesystem@1.0.2(transitive)
- Removedsyntex-logger@1.0.8(transitive)
- Removedsyntex-webserver@1.1.0(transitive)