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

homebridge-syntex-webhooks

Package Overview
Dependencies
Maintainers
1
Versions
1176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

homebridge-syntex-webhooks - npm Package Compare versions

Comparing version 2.3.8-b9 to 2.3.8

22

.eslintrc.json
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 13,
"sourceType": "module"
},
"rules": {}
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 13,
"sourceType": "module"
},
"rules": {}
}

@@ -1,3 +0,1 @@

let DeviceManager = require('./src/device-manager');
const { DynamicPlatform } = require('homebridge-syntex-dynamic-platform');

@@ -7,2 +5,4 @@

const DeviceManager = require('./src/device-manager');
const pluginID = 'homebridge-syntex-webhooks';

@@ -24,3 +24,3 @@ const pluginName = 'SynTexWebHooks';

DeviceManager = new DeviceManager(this);
this.DeviceManager = new DeviceManager(this);

@@ -42,7 +42,7 @@ this.loadAccessories();

device.manufacturer = pluginName;
device.manufacturer = this.pluginName;
this.addAccessory(new SynTexUniversalAccessory(homebridgeAccessory, device, { platform : this, DeviceManager }));
this.addAccessory(new SynTexUniversalAccessory(homebridgeAccessory, device, { platform : this, DeviceManager : this.DeviceManager }));
}
}
}
{
"name": "homebridge-syntex-webhooks",
"version": "2.3.8-b9",
"version": "2.3.8",
"description": "A webhook plugin for HTTP devices",

@@ -14,5 +14,4 @@ "main": "index.js",

"dependencies": {
"axios": "^0.21.1",
"color-convert": "^1.5.0",
"homebridge-syntex-dynamic-platform": "1.0.8-b13",
"homebridge-syntex-dynamic-platform": "1.0.8-b42",
"json-fs-store": "^1.0.1"

@@ -19,0 +18,0 @@ },

@@ -1,2 +0,2 @@

const axios = require('axios'), convert = require('color-convert');
const convert = require('color-convert');

@@ -10,4 +10,6 @@ module.exports = class DeviceManager

this.logger = platform.logger;
this.typeManager = platform.TypeManager;
this.RequestManager = platform.RequestManager;
this.TypeManager = platform.TypeManager;
this.accessories = platform.accessories;

@@ -43,20 +45,23 @@

axios.get(url, { timeout : 25000 }).then(() => {
this.RequestManager.fetch(url, { timeout : 25000 }).then((response) => {
this.connections[url] = 0;
if(accessory.setConnectionState != null)
if(response.data != null)
{
accessory.setConnectionState(true, null, true);
}
this.connections[url] = 0;
}).catch(() => {
if(this.connections[url] < 2)
{
this.connections[url]++;
if(accessory.setConnectionState != null)
{
accessory.setConnectionState(true, null, true);
}
}
else if(accessory.setConnectionState != null)
else
{
accessory.setConnectionState(false, null, true);
if(this.connections[url] < 2)
{
this.connections[url]++;
}
else if(accessory.setConnectionState != null)
{
accessory.setConnectionState(false, null, true);
}
}

@@ -131,14 +136,11 @@ });

{
axios.get(urlToCall, theRequest).then(function(response) {
this.RequestManager.fetch(urlToCall, theRequest).then(function(response) {
success++;
if(response.data != null)
{
success++;
}
this.logger.log(response.data != null ? 'success' : 'error', service.id, service.letters, '[' + service.name + '] %request_result[0]% [' + this.url + '] %request_result[1]% [' + (response.status || -1)+ '] %request_result[2]%: [' + (response.data || '') + ']', response.error || '');
this.logger.log('success', service.id, service.letters, '[' + service.name + '] %request_result[0]% [' + this.url + '] %request_result[1]% [' + response.status + '] %request_result[2]%: [' + (response.data || '') + ']');
}.bind({ url : urlToCall, logger : this.logger })).catch(function(err) {
this.logger.log('error', service.id, service.letters, '[' + service.name + '] %request_result[0]% [' + this.url + '] %request_result[1]% [' + (err.response != null ? err.response.status : -1)+ '] %request_result[2]%: [' + (err.response != null ? err.response.data : '') + ']', err.stack);
}.bind({ url : urlToCall, logger : this.logger })).then(function() {
finished++;

@@ -153,3 +155,3 @@

if(success == 0 && this.typeManager.letterToType(service.letters) == 'relais')
if(success == 0 && this.TypeManager.letterToType(service.letters) == 'relais')
{

@@ -163,4 +165,4 @@ resolve(false);

}
}.bind({ url : urlToCall, typeManager : this.typeManager }));
}.bind({ url : urlToCall, logger : this.logger, TypeManager : this.TypeManager }));
}

@@ -176,12 +178,6 @@ else if(service.options.requests[i].trigger.toLowerCase() == 'color')

axios.get(urlToCall + colors[0] + ',' + colors[1] + ',' + (state.value ? colors[2] : 0), theRequest).then(function(response) {
this.RequestManager.fetch(urlToCall + colors[0] + ',' + colors[1] + ',' + (state.value ? colors[2] : 0), theRequest).then(function(response) {
this.logger.log('success', service.id, service.letters, '[' + service.name + '] %request_result[0]% [' + this.url + '] %request_result[1]% [' + response.status + '] %request_result[2]%: [' + (response.data || '') + '] ');
}.bind({ url : urlToCall + colors[0] + ',' + colors[1] + ',' + (state.value ? colors[2] : 0), logger : this.logger })).catch(function(err) {
this.logger.log(response.data != null ? 'success' : 'error', service.id, service.letters, '[' + service.name + '] %request_result[0]% [' + this.url + '] %request_result[1]% [' + (response.status || -1) + '] %request_result[2]%: [' + (response.data || '') + ']', response.error || '');
this.logger.log('error', service.id, service.letters, '[' + service.name + '] %request_result[0]% [' + this.url + '] %request_result[1]% [' + (err.response != null ? err.response.status : -1) + '] %request_result[2]%: [' + (err.response != null ? err.response.data : '') + ']', err.stack);
}.bind({ url : urlToCall + colors[0] + ',' + colors[1] + ',' + (state.value ? colors[2] : 0), logger : this.logger })).then(() => {
finished++;

@@ -198,16 +194,11 @@

}
});
}.bind({ url : urlToCall + colors[0] + ',' + colors[1] + ',' + (state.value ? colors[2] : 0), logger : this.logger }));
}
else if(service.options.requests[i].trigger.toLowerCase() == 'dimmer')
{
axios.get(urlToCall + state.brightness, theRequest).then(function(response) {
this.RequestManager.fetch(urlToCall + state.brightness, theRequest).then(function(response) {
this.logger.log('success', service.id, service.letters, '[' + service.name + '] %request_result[0]% [' + this.url + '] %request_result[1]% [' + response.status + '] %request_result[2]%: [' + (response.data || '') + '] ');
}.bind({ url : urlToCall + state.brightness, logger : this.logger })).catch(function(err) {
this.logger.log(response.data != null ? 'success' : 'error', service.id, service.letters, '[' + service.name + '] %request_result[0]% [' + this.url + '] %request_result[1]% [' + (response.status || -1) + '] %request_result[2]%: [' + (response.data || '') + ']', response.error || '');
this.logger.log('error', service.id, service.letters, '[' + service.name + '] %request_result[0]% [' + this.url + '] %request_result[1]% [' + (err.response != null ? err.response.status : -1) + '] %request_result[2]%: [' + (err.response != null ? err.response.data : '') + ']', err.stack);
}.bind({ url : urlToCall + state.brightness, logger : this.logger })).then(() => {
finished++;

@@ -224,3 +215,4 @@

}
});
}.bind({ url : urlToCall + state.brightness, logger : this.logger }));
}

@@ -227,0 +219,0 @@ }

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