syntex-automation
Advanced tools
Comparing version 1.2.0-b26 to 1.2.0-b27
{ | ||
"name": "syntex-automation", | ||
"version": "1.2.0-b26", | ||
"version": "1.2.0-b27", | ||
"description": "An automation system for your smart home", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
@@ -365,3 +365,3 @@ const axios = require('axios'); | ||
executeResult(automation, trigger) | ||
async executeResult(automation, trigger) | ||
{ | ||
@@ -372,2 +372,7 @@ var success = false; | ||
{ | ||
if(block.time != null) | ||
{ | ||
await new Promise((resolve) => setTimeout(() => resolve(), block.time)); | ||
} | ||
if(block.url != null) | ||
@@ -550,7 +555,9 @@ { | ||
_getOutput(block, state) | ||
_getOutput(block, state = {}) | ||
{ | ||
var now = new Date(); | ||
if(block.time != null && block.time.includes(':') && block.operation != null) | ||
{ | ||
var now = new Date(), begin = new Date(), end = new Date(); | ||
var begin = new Date(), end = new Date(); | ||
@@ -597,4 +604,9 @@ begin.setMinutes(0); | ||
if(block.id != null && block.letters != null && block.state != null && block.operation != null) | ||
if(block.days != null && Array.isArray(block.days) && block.days.includes(now.getDay())) | ||
{ | ||
return true; | ||
} | ||
if(block.id != null && block.letters != null && block.state != null && block.state instanceof Object && block.operation != null) | ||
{ | ||
if(block.operation == '>') | ||
@@ -718,3 +730,3 @@ { | ||
{ | ||
if(block.time != null) | ||
if(block.time != null || block.days != null) | ||
{ | ||
@@ -738,3 +750,3 @@ return true; | ||
{ | ||
if((block.id == service.id && block.letters == service.letters) || block.time != null) | ||
if((block.id == service.id && block.letters == service.letters) || block.time != null || block.days != null) | ||
{ | ||
@@ -741,0 +753,0 @@ if(!this._getOutput(block, state)) |
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
24593
685