Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

syntex-automation

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

syntex-automation - npm Package Compare versions

Comparing version 1.2.0-b11 to 1.2.0-b12

2

package.json
{
"name": "syntex-automation",
"version": "1.2.0-b11",
"version": "1.2.0-b12",
"description": "An automation system for your smart home",

@@ -5,0 +5,0 @@ "main": "main.js",

@@ -14,2 +14,4 @@ const axios = require('axios');

this.sockets = {};
this.platform = platform;

@@ -35,3 +37,5 @@

{
this.timeInterval = setInterval(() => this.loadLock().then(() => {
this.initNetwork();
this.timeInterval = setInterval(() => {

@@ -62,2 +66,4 @@ var changed = false;

this.stateLock[this.automation[i].id].trigger[blocks[j].blockID] = false;
this._updateSockets(false, this.automation[i].id, blocks[j].blockID);

@@ -78,3 +84,3 @@ this.logger.debug('Automation [' + this.automation[i].name + '] %automation_different% ' + this.automation[i].id + ' ' + blocks[j].blockID);

}), 60000);
}, 60000);

@@ -129,2 +135,31 @@ this.ready = true;

initNetwork()
{
if(this.platform.WebServer != null)
{
this.platform.WebServer.addSocket('/automation', 'setLock', (ws, params) => {
if(params.id != null && params.lock != null)
{
if(params.blockID != null)
{
this.stateLock[params.id].trigger[params.blockID] = params.lock;
}
else
{
this.stateLock[params.id].result = params.lock;
}
}
});
}
for(const i in this.manager.RouteManager.plugins)
{
if(this.manager.RouteManager.plugins[i].port != this.platform.port)
{
this.sockets[this.manager.RouteManager.plugins[i].port] = this.platform.WebServer.connectSocket('ws://localhost:' + this.manager.RouteManager.plugins[i].port + '/automation', () => {});
}
}
}
parseAutomation()

@@ -249,2 +284,4 @@ {

this._updateSockets(false, this.automation[i].id, blocks[j].blockID);
if(blocks[j].operation == '<')

@@ -378,2 +415,4 @@ {

this._updateSockets(false, automation.id);
this.logger.debug('Automation [' + automation.name + '] %automation_different% ' + automation.id);

@@ -568,2 +607,4 @@ }

this._updateSockets(true, automation.id, i + '' + j);
changed = true;

@@ -583,2 +624,4 @@ }

this._updateSockets(true, automation.id);
changed = true;

@@ -732,2 +775,17 @@ }

}
_updateSockets(lock, id, blockID)
{
var params = { id, lock };
if(blockID != null)
{
params.blockID = blockID;
}
for(const i in this.sockets)
{
this.sockets[i].send(JSON.stringify({ line : 'setLock', params }))
}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc