syntex-automation
Advanced tools
Comparing version 1.2.0-b21 to 1.2.0-b22
28
main.js
let LogikEngine = require('./src/automation'), RouteManager = require('./src/route-manager'); | ||
const EventEmitter = require('events'); | ||
module.exports = class AutomationSystem extends EventEmitter | ||
module.exports = class AutomationSystem | ||
{ | ||
constructor(platform) | ||
{ | ||
super(); | ||
super.setMaxListeners(512); | ||
this.pluginName = platform.pluginName; | ||
@@ -19,22 +13,2 @@ this.logger = platform.logger; | ||
} | ||
setInputStream(stream, sender, callback) | ||
{ | ||
super.on(stream, (destination, state) => { | ||
if(sender.id == destination.id && sender.letters == destination.letters) | ||
{ | ||
callback(state); | ||
this.logger.debug('<<< ' + stream + ' [' + JSON.stringify(destination) + '] ' + JSON.stringify(state)); | ||
} | ||
}); | ||
} | ||
setOutputStream(stream, destination, state) | ||
{ | ||
this.logger.debug('>>> ' + stream + ' [' + JSON.stringify(destination) + '] ' + JSON.stringify(state)); | ||
super.emit(stream, destination, state); | ||
} | ||
} |
{ | ||
"name": "syntex-automation", | ||
"version": "1.2.0-b21", | ||
"version": "1.2.0-b22", | ||
"description": "An automation system for your smart home", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
@@ -529,6 +529,6 @@ const axios = require('axios'); | ||
if(result.plugin != null && this.manager.pluginName != result.plugin && this.manager.RouteManager.getPort(result.plugin) != null) | ||
if(result.bridge != null && result.port != null) | ||
{ | ||
let theRequest = { | ||
url : 'http://' + (result.bridge || '127.0.0.1') + ':' + this.manager.RouteManager.getPort(result.plugin) + '/devices?id=' + result.id + '&type=' + this.TypeManager.letterToType(result.letters[0]) + '&counter=' + result.letters[1], | ||
url : 'http://' + result.bridge + ':' + result.port + '/devices?id=' + result.id + '&type=' + this.TypeManager.letterToType(result.letters[0]) + '&counter=' + result.letters[1], | ||
timeout : 10000 | ||
@@ -546,3 +546,3 @@ }; | ||
{ | ||
this.manager.setOutputStream('SynTexAutomation', { id : result.id, letters : result.letters }, state); | ||
this.EventManager.setOutputStream('changeHandler', { receiver : { id : result.id, letters : result.letters } }, state); | ||
} | ||
@@ -644,6 +644,6 @@ | ||
{ | ||
if(block.plugin != null && this.manager.pluginName != block.plugin && this.manager.RouteManager.getPort(block.plugin) != null) | ||
if((block.bridge != null && block.port != null) || (block.plugin != null && this.manager.pluginName != block.plugin && this.manager.RouteManager.getPort(block.plugin) != null)) | ||
{ | ||
var theRequest = { | ||
url : 'http://' + (block.bridge || '127.0.0.1') + ':' + this.manager.RouteManager.getPort(block.plugin) + '/devices?id=' + block.id + '&type=' + this.TypeManager.letterToType(block.letters[0]) + '&counter=' + block.letters[1], | ||
url : 'http://' + (block.bridge || '127.0.0.1') + ':' + (block.port || this.manager.RouteManager.getPort(block.plugin)) + '/devices?id=' + block.id + '&type=' + this.TypeManager.letterToType(block.letters[0]) + '&counter=' + block.letters[1], | ||
timeout : 10000 | ||
@@ -650,0 +650,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
27036
704