homebridge-syntex-dynamic-platform
Advanced tools
Comparing version 1.0.8-b48 to 1.0.8-b49
117
main.js
@@ -138,72 +138,81 @@ const fs = require('fs'), path = require('path'); | ||
if(urlParams.remove != null) | ||
if(service != null) | ||
{ | ||
if(urlParams.type != null) | ||
if(urlParams.remove != null) | ||
{ | ||
response.end(urlParams.remove == 'CONFIRM' && await accessory.removeService(accessory, service) ? 'Success' : 'Error'); | ||
if(urlParams.type != null) | ||
{ | ||
response.end(urlParams.remove == 'CONFIRM' && await accessory.removeService(accessory, service) ? 'Success' : 'Error'); | ||
} | ||
else | ||
{ | ||
response.end(urlParams.remove == 'CONFIRM' && await this.removeAccessory(accessory.homebridgeAccessory || accessory, urlParams.id) ? 'Success' : 'Error'); | ||
} | ||
} | ||
else | ||
{ | ||
response.end(urlParams.remove == 'CONFIRM' && await this.removeAccessory(accessory.homebridgeAccessory || accessory, urlParams.id) ? 'Success' : 'Error'); | ||
} | ||
} | ||
else | ||
{ | ||
if(service != null) | ||
{ | ||
if(urlParams.value != null) | ||
if(service != null) | ||
{ | ||
let state = { value : urlParams.value }; | ||
if(urlParams.hue != null) | ||
if(urlParams.value != null) | ||
{ | ||
state.hue = urlParams.hue; | ||
let state = { value : urlParams.value }; | ||
if(urlParams.hue != null) | ||
{ | ||
state.hue = urlParams.hue; | ||
} | ||
if(urlParams.saturation != null) | ||
{ | ||
state.saturation = urlParams.saturation; | ||
} | ||
if(urlParams.brightness != null) | ||
{ | ||
state.brightness = urlParams.brightness; | ||
} | ||
if(urlParams.event != null) | ||
{ | ||
state.event = urlParams.event; | ||
} | ||
state = this.updateAccessoryService(service, state); | ||
response.end(state != null ? 'Success' : 'Error'); | ||
} | ||
if(urlParams.saturation != null) | ||
else | ||
{ | ||
state.saturation = urlParams.saturation; | ||
let state = null; | ||
if(accessory.homebridgeAccessory != null | ||
&& accessory.homebridgeAccessory.context != null | ||
&& accessory.homebridgeAccessory.context.data != null) | ||
{ | ||
if(urlParams.type == null && urlParams.counter == null) | ||
{ | ||
state = accessory.homebridgeAccessory.context.data; | ||
} | ||
else if(service != null && service.letters != null) | ||
{ | ||
state = accessory.homebridgeAccessory.context.data[service.letters]; | ||
} | ||
} | ||
response.end(state != null ? JSON.stringify(state) : 'Error'); | ||
} | ||
if(urlParams.brightness != null) | ||
{ | ||
state.brightness = urlParams.brightness; | ||
} | ||
if(urlParams.event != null) | ||
{ | ||
state.event = urlParams.event; | ||
} | ||
state = this.updateAccessoryService(service, state); | ||
response.end(state != null ? 'Success' : 'Error'); | ||
} | ||
else | ||
{ | ||
let state = null; | ||
if(accessory.homebridgeAccessory != null | ||
&& accessory.homebridgeAccessory.context != null | ||
&& accessory.homebridgeAccessory.context.data != null) | ||
{ | ||
if(urlParams.type == null && urlParams.counter == null) | ||
{ | ||
state = accessory.homebridgeAccessory.context.data; | ||
} | ||
else if(service != null && service.letters != null) | ||
{ | ||
state = accessory.homebridgeAccessory.context.data[service.letters]; | ||
} | ||
} | ||
response.end(state != null ? JSON.stringify(state) : 'Error'); | ||
response.end('Error'); | ||
this.logger.log('error', urlParams.id, (urlParams.type != null ? (this.TypeManager.typeToLetter(urlParams.type) || urlParams.type) : 'X') + (urlParams.counter || '0'), '%accessory_not_found[3]% ( ' + (urlParams.type != null ? (this.TypeManager.typeToLetter(urlParams.type) || urlParams.type) : 'X') + (urlParams.counter || '0') + ' )'); | ||
} | ||
} | ||
else | ||
{ | ||
response.end('Error'); | ||
} | ||
else | ||
{ | ||
response.end('Error'); | ||
this.logger.log('error', urlParams.id, (urlParams.type != null ? (this.TypeManager.typeToLetter(urlParams.type) || urlParams.type) : 'X') + (urlParams.counter || '0'), '%accessory_not_found[3]% ( ' + (urlParams.type != null ? (this.TypeManager.typeToLetter(urlParams.type) || urlParams.type) : 'X') + (urlParams.counter || '0') + ' )'); | ||
} | ||
this.logger.log('error', urlParams.id, '', '%accessory_not_found[2]%! ( ' + urlParams.id + ' )'); | ||
} | ||
@@ -210,0 +219,0 @@ } |
{ | ||
"name": "homebridge-syntex-dynamic-platform", | ||
"version": "1.0.8-b48", | ||
"version": "1.0.8-b49", | ||
"description": "A Dynamic Platform Accessory", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
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
79983
2302