syntex-automation
Advanced tools
Comparing version 1.2.1-b23 to 1.2.1-b24
{ | ||
"name": "syntex-automation", | ||
"version": "1.2.1-b23", | ||
"version": "1.2.1-b24", | ||
"description": "An automation system for your smart home", | ||
@@ -12,3 +12,3 @@ "main": "main.js", | ||
"dependencies": { | ||
"syntex-filesystem": "1.0.3-b9", | ||
"syntex-filesystem": "1.0.3-b10", | ||
"syntex-logger": "1.0.9-b2" | ||
@@ -15,0 +15,0 @@ }, |
@@ -24,46 +24,49 @@ module.exports = class Automation | ||
this.loadAutomation().then((automationSuccess) => { | ||
if(this.files.checkFile('automation/automation.json')) | ||
{ | ||
this.loadAutomation().then((automationSuccess) => { | ||
if(automationSuccess) | ||
{ | ||
this.loadLock().then((lockSuccess) => { | ||
if(lockSuccess) | ||
{ | ||
this.initNetwork(); | ||
this.timeInterval = setInterval(() => { | ||
var promiseArray = []; | ||
for(const automation of this.automation) | ||
{ | ||
if(automation.active && this._includesTime(automation)) | ||
if(automationSuccess) | ||
{ | ||
this.loadLock().then((lockSuccess) => { | ||
if(lockSuccess) | ||
{ | ||
this.initNetwork(); | ||
this.timeInterval = setInterval(() => { | ||
var promiseArray = []; | ||
for(const automation of this.automation) | ||
{ | ||
promiseArray.push(this._checkLock(automation)); | ||
if(!this._isLocked(automation)) | ||
if(automation.active && this._includesTime(automation)) | ||
{ | ||
this.checkTrigger(automation, { name : ('0' + new Date().getHours()).slice(-2) + ':' + ('0' + new Date().getMinutes()).slice(-2) }); | ||
promiseArray.push(this._checkLock(automation)); | ||
if(!this._isLocked(automation)) | ||
{ | ||
this.checkTrigger(automation, { name : ('0' + new Date().getHours()).slice(-2) + ':' + ('0' + new Date().getMinutes()).slice(-2) }); | ||
} | ||
} | ||
} | ||
} | ||
Promise.all(promiseArray).then((result) => { | ||
if(result.includes(true)) | ||
{ | ||
this.files.writeFile('automation/automation-lock.json', { timeLock : this.timeLock, stateLock : this.stateLock }); | ||
} | ||
}); | ||
}, 60000); | ||
this.logger.log('success', 'automation', 'Automation', '%automation_load_success%!'); | ||
this.ready = true; | ||
} | ||
}); | ||
} | ||
}); | ||
Promise.all(promiseArray).then((result) => { | ||
if(result.includes(true)) | ||
{ | ||
this.files.writeFile('automation/automation-lock.json', { timeLock : this.timeLock, stateLock : this.stateLock }); | ||
} | ||
}); | ||
}, 60000); | ||
this.logger.log('success', 'automation', 'Automation', '%automation_load_success%!'); | ||
this.ready = true; | ||
} | ||
}); | ||
} | ||
}); | ||
} | ||
} | ||
@@ -70,0 +73,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
26609
790
+ Addedsyntex-filesystem@1.0.3-b10(transitive)
- Removedsyntex-filesystem@1.0.3-b9(transitive)
Updatedsyntex-filesystem@1.0.3-b10