syntex-automation
Advanced tools
Comparing version 1.2.1-b28 to 1.2.1-b29
@@ -10,5 +10,5 @@ let LogikEngine = require('./src/automation'), RouteManager = require('./src/route-manager'); | ||
this.RouteManager = new RouteManager(platform.logger, platform.files, platform.api.user.storagePath()); | ||
this.RouteManager = new RouteManager(platform); | ||
this.LogikEngine = new LogikEngine(platform, this); | ||
} | ||
} |
{ | ||
"name": "syntex-automation", | ||
"version": "1.2.1-b28", | ||
"version": "1.2.1-b29", | ||
"description": "An automation system for your smart home", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
@@ -1,4 +0,4 @@ | ||
module.exports = class Automation | ||
module.exports = class AutomationSystem | ||
{ | ||
constructor(platform, manager) | ||
constructor(platform, ActivityManager) | ||
{ | ||
@@ -20,6 +20,9 @@ this.ready = false; | ||
this.RequestManager = platform.RequestManager; | ||
this.TypeManager = platform.TypeManager; | ||
this.manager = manager; | ||
this.ActivityManager = ActivityManager; | ||
this.RouteManager = ActivityManager.RouteManager; | ||
this.TypeManager = platform.TypeManager; | ||
if(this.files.checkFile('automation/automation.json')) | ||
@@ -495,6 +498,6 @@ { | ||
{ | ||
if((block.bridge != null && block.port != null) || (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.ActivityManager.pluginName != block.plugin && this.RouteManager.getPort(block.plugin) != null)) | ||
{ | ||
var theRequest = { | ||
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.slice(1), | ||
url : 'http://' + (block.bridge || '127.0.0.1') + ':' + (block.port || this.RouteManager.getPort(block.plugin)) + '/devices?id=' + block.id + '&type=' + this.TypeManager.letterToType(block.letters[0]) + '&counter=' + block.letters.slice(1), | ||
timeout : 10000 | ||
@@ -608,7 +611,7 @@ }; | ||
{ | ||
if((id == null || automation.id == id) && automation.trigger != null && automation.trigger.groups != null) | ||
if((id == null || automation.id == id) && automation.trigger != null && Array.isArray(automation.trigger.groups)) | ||
{ | ||
for(const i in automation.trigger.groups) | ||
{ | ||
if(automation.trigger.groups[i].blocks != null) | ||
if(Array.isArray(automation.trigger.groups[i].blocks)) | ||
{ | ||
@@ -615,0 +618,0 @@ for(const j in automation.trigger.groups[i].blocks) |
module.exports = class RouteManager | ||
{ | ||
constructor(logger, files, configPath) | ||
constructor(platform) | ||
{ | ||
this.plugins = []; | ||
this.logger = logger; | ||
this.files = files; | ||
this.logger = platform.logger; | ||
this.files = platform.files; | ||
if(configPath != null) | ||
if(platform.api.user.storagePath() != null) | ||
{ | ||
this.files.readFile(configPath + '/config.json').then((data) => { | ||
this.files.readFile(platform.api.user.storagePath() + '/config.json').then((data) => { | ||
@@ -14,0 +14,0 @@ if(data != null && data.platforms != null) |
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
26049
768