Socket
Socket
Sign inDemoInstall

syntex-automation

Package Overview
Dependencies
Maintainers
1
Versions
112
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.0.2-b1 to 1.0.2-b10

automation.js

44

main.js

@@ -0,8 +1,16 @@

let LogikEngine = require('./automation');
const EventEmitter = require('events'), request = require('request');
class AutomationSystem extends EventEmitter
module.exports = class AutomationSystem extends EventEmitter
{
constructor()
constructor(logger, storagePath, dataManager, isServer)
{
super();
super.setMaxListeners(256);
this.logger = logger;
this.LogikEngine = new LogikEngine(logger, storagePath, dataManager, isServer, this);
}

@@ -12,3 +20,8 @@

{
super.on(stream, (reciever, values) => callback(reciever, values));
super.on(stream, (reciever, values) => {
this.logger.debug('<<< ' + stream + ' ' + JSON.stringify(reciever) + ' ' + JSON.stringify(values));
callback(reciever, values)
});
}

@@ -18,17 +31,14 @@

{
if(!super.emit(stream, reciever, values))
{
}
super.emit(stream, reciever, values);
sendToAutomationServer(values);
this.logger.debug('>>> ' + stream + ' ' + JSON.stringify(reciever) + ' ' + JSON.stringify(values));
}
sendToAutomationServer(values)
sendToAutomationServer(id, letters, values)
{
var url = 'http://localhost:1777/update-automation', first = true;
var url = 'http://localhost:1777/update-automation?id=' + id + '&letters=' + letters;
for(const value in Object.keys(values))
for(const value of Object.keys(values))
{
url += (first ? '?' : '&') + value + '=' + values[value];
url += '&' + value + '=' + values[value];
}

@@ -41,11 +51,5 @@

};
request(theRequest, () => {});
}
}
const automation = new AutomationSystem();
automation.setMaxListeners(256);
module.exports = automation;
}
{
"name": "syntex-automation",
"version": "1.0.2-b1",
"version": "1.0.2-b10",
"description": "An automation system for your smart home",

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

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