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

homebridge-syntex-dynamic-platform

Package Overview
Dependencies
Maintainers
1
Versions
348
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

homebridge-syntex-dynamic-platform - npm Package Compare versions

Comparing version 1.0.0-b2 to 1.0.0-b3

15

accessories/base.js
module.exports = class BaseService
{
constructor(homebridgeAccessory, deviceConfig, serviceType, type, subtype, manager)
constructor(homebridgeAccessory, deviceConfig, serviceConfig, serviceType, manager)
{
var service = homebridgeAccessory.getServiceById(serviceType, subtype);
this.id = deviceConfig.id;
this.name = serviceConfig.name;
var service = homebridgeAccessory.getServiceById(serviceType, serviceConfig.subtype);
if(service)
{
manager.logger.debug('Existierenden Service gefunden! ' + deviceConfig.name + ' ' + type + ' ' + subtype + ' ( ' + deviceConfig.id + ' )');
manager.logger.debug('Existierenden Service gefunden! ' + serviceConfig.name + ' ' + serviceConfig.type + ' ' + serviceConfig.subtype + ' ( ' + this.id + ' )');
service.setCharacteristic(manager.platform.api.hap.Characteristic.Name, deviceConfig.name);
service.setCharacteristic(manager.platform.api.hap.Characteristic.Name, serviceConfig.name);
}
else
{
manager.logger.debug('Erstelle neuen Service! ' + deviceConfig.name + ' ' + type + ' ' + subtype + ' ( ' + deviceConfig.id + ' )');
manager.logger.debug('Erstelle neuen Service! ' + serviceConfig.name + ' ' + serviceConfig.type + ' ' + serviceConfig.subtype + ' ( ' + this.id + ' )');
homebridgeAccessory.addService(serviceType, deviceConfig.name, subtype)
homebridgeAccessory.addService(serviceType, serviceConfig.name, serviceConfig.subtype)
//homebridgeAccessory.service.push();

@@ -19,0 +22,0 @@ }

8

accessories/lightbulb.js

@@ -8,3 +8,3 @@ const BaseService = require('./base');

{
constructor(homebridgeAccessory, deviceConfig, subtype, manager)
constructor(homebridgeAccessory, deviceConfig, serviceConfig, manager)
{

@@ -14,7 +14,7 @@ Service = manager.platform.api.hap.Service;

super(homebridgeAccessory, deviceConfig, Service.Lightbulb, 'led', subtype, manager);
super(homebridgeAccessory, deviceConfig, serviceConfig, Service.Lightbulb, manager);
this.letters = '3' + subtype;
this.letters = '3' + serviceConfig.subtype;
homebridgeAccessory.getServiceById(Service.Lightbulb, subtype).getCharacteristic(Characteristic.On).on('get', this.getState.bind(this)).on('set', this.setState.bind(this));
homebridgeAccessory.getServiceById(Service.Lightbulb, serviceConfig.subtype).getCharacteristic(Characteristic.On).on('get', this.getState.bind(this)).on('set', this.setState.bind(this));
}

@@ -21,0 +21,0 @@

@@ -8,3 +8,3 @@ const BaseService = require('./base');

{
constructor(homebridgeAccessory, deviceConfig, subtype, manager)
constructor(homebridgeAccessory, deviceConfig, serviceConfig, manager)
{

@@ -14,7 +14,7 @@ Service = manager.platform.api.hap.Service;

super(homebridgeAccessory, deviceConfig, Service.Outlet, 'outlet', subtype, manager);
super(homebridgeAccessory, deviceConfig, serviceConfig, Service.Outlet, manager);
this.letters = '7' + subtype;
this.letters = '7' + serviceConfig.subtype;
homebridgeAccessory.getServiceById(Service.Outlet, subtype).getCharacteristic(Characteristic.On).on('get', this.getState.bind(this)).on('set', this.setState.bind(this));
homebridgeAccessory.getServiceById(Service.Outlet, serviceConfig.subtype).getCharacteristic(Characteristic.On).on('get', this.getState.bind(this)).on('set', this.setState.bind(this));
}

@@ -21,0 +21,0 @@

@@ -8,3 +8,3 @@ const BaseService = require('./base');

{
constructor(homebridgeAccessory, deviceConfig, subtype, manager)
constructor(homebridgeAccessory, deviceConfig, serviceConfig, manager)
{

@@ -14,7 +14,7 @@ Service = manager.platform.api.hap.Service;

super(homebridgeAccessory, deviceConfig, Service.Switch, 'switch', subtype, manager);
super(homebridgeAccessory, deviceConfig, serviceConfig, Service.Switch, manager);
this.letters = '4' + subtype;
this.letters = '4' + serviceConfig.subtype;
homebridgeAccessory.getServiceById(Service.Switch, subtype).getCharacteristic(Characteristic.On).on('get', this.getState.bind(this)).on('set', this.setState.bind(this));
homebridgeAccessory.getServiceById(Service.Switch, serviceConfig.subtype).getCharacteristic(Characteristic.On).on('get', this.getState.bind(this)).on('set', this.setState.bind(this));
}

@@ -21,0 +21,0 @@

@@ -84,3 +84,3 @@ const OutletService = require('./outlet');

{
//var name = this.name;
var name = this.name;
var type = config;

@@ -90,3 +90,2 @@

{
/*
if(config.name != null)

@@ -96,3 +95,3 @@ {

}
*/
if(config.type != null)

@@ -106,11 +105,11 @@ {

{
var service = new SwitchService(this.homebridgeAccessory, this.deviceConfig, subtype, this.manager);
var service = new SwitchService(this.homebridgeAccessory, this.deviceConfig, { name : name, type : type, subtype : subtype }, this.manager);
}
else if(type == 'outlet')
{
var service = new OutletService(this.homebridgeAccessory, this.deviceConfig, subtype, this.manager);
var service = new OutletService(this.homebridgeAccessory, this.deviceConfig, { name : name, type : type, subtype : subtype }, this.manager);
}
else if(type == 'rgb')
{
var service = new LightBulbService(this.homebridgeAccessory, this.deviceConfig, subtype, this.manager);
var service = new LightBulbService(this.homebridgeAccessory, this.deviceConfig, { name : name, type : type, subtype : subtype }, this.manager);
}

@@ -117,0 +116,0 @@

{
"name": "homebridge-syntex-dynamic-platform",
"version": "1.0.0-b2",
"version": "1.0.0-b3",
"description": "A Dynamic Platform Accessory",

@@ -5,0 +5,0 @@ "main": "index.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