Socket
Socket
Sign inDemoInstall

homebridge-syntex-dynamic-platform

Package Overview
Dependencies
Maintainers
1
Versions
345
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.8-b42 to 1.0.8-b43

src/accessories/thermostat.js

3

main.js

@@ -22,2 +22,3 @@ const fs = require('fs'), path = require('path');

const BlindService = require('./src/accessories/blind');
const ThermostatService = require('./src/accessories/thermostat');

@@ -558,2 +559,2 @@ const ConnectionCharacteristic = require('./src/characteristics/connection');

module.exports = { DynamicPlatform, UniversalAccessory, AccessoryInformationService, OutletService, SwitchService, LightBulbService, DimmedBulbService, ColoredBulbService, ContactService, LightService, MotionService, TemperatureService, HumidityService, LeakService, OccupancyService, StatelessSwitchService, SmokeService, AirQualityService, BlindService };
module.exports = { DynamicPlatform, UniversalAccessory, AccessoryInformationService, OutletService, SwitchService, LightBulbService, DimmedBulbService, ColoredBulbService, ContactService, LightService, MotionService, TemperatureService, HumidityService, LeakService, OccupancyService, StatelessSwitchService, SmokeService, AirQualityService, BlindService, ThermostatService };
{
"name": "homebridge-syntex-dynamic-platform",
"version": "1.0.8-b42",
"version": "1.0.8-b43",
"description": "A Dynamic Platform Accessory",

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

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

this.value = super.getValue('value', true);
this.position = super.getValue('position');
this.mode = super.getValue('mode');

@@ -19,3 +19,3 @@ homebridgeAccessory.getServiceById(this.Service.WindowCovering, serviceConfig.subtype).getCharacteristic(this.Characteristic.TargetPosition).on('get', this.getTargetPosition.bind(this)).on('set', this.setTargetPosition.bind(this));

homebridgeAccessory.getServiceById(this.Service.WindowCovering, serviceConfig.subtype).getCharacteristic(this.Characteristic.CurrentPosition).updateValue(this.value);
homebridgeAccessory.getServiceById(this.Service.WindowCovering, serviceConfig.subtype).getCharacteristic(this.Characteristic.PositionState).updateValue(this.position);
homebridgeAccessory.getServiceById(this.Service.WindowCovering, serviceConfig.subtype).getCharacteristic(this.Characteristic.PositionState).updateValue(this.mode);

@@ -37,3 +37,3 @@ this.changeHandler = (state) => {

super.setValue('value', state[c.type]);
super.setValue(c.type, state[c.type]);
}

@@ -71,3 +71,3 @@ }

{
callback(super.getValue('position', verbose));
callback(super.getValue('mode', verbose));
}

@@ -77,3 +77,3 @@

{
super.setValue('position', level, verbose);
super.setValue('mode', level, verbose);

@@ -80,0 +80,0 @@ callback();

@@ -49,3 +49,3 @@ const DimmedBulbService = require('./dimmedBulb');

super.setValue('value', state[c.type]);
super.setValue(c.type, state[c.type]);
}

@@ -52,0 +52,0 @@ }

@@ -42,3 +42,3 @@ const LightBulbService = require('./lightBulb');

super.setValue('value', state[c.type]);
super.setValue(c.type, state[c.type]);
}

@@ -45,0 +45,0 @@ }

@@ -151,7 +151,7 @@ module.exports = class BaseService

{
var stateText = JSON.stringify(state[key]), characteristics = Object.keys(this.homebridgeAccessory.context.data[this.letters]);
var stateText = JSON.stringify(state[key]), characteristics = this.homebridgeAccessory.context.data[this.letters];
if(characteristics.length > 1)
if(Object.keys(characteristics).length > 1)
{
stateText = 'value: ' + stateText;
stateText = 'value: ' + characteristics.value;
}

@@ -174,7 +174,12 @@

if(characteristics.position != null)
if(characteristics.target != null)
{
stateText += ', position: ' + characteristics.position;
stateText += ', target: ' + characteristics.target;
}
if(characteristics.mode != null)
{
stateText += ', mode: ' + characteristics.mode;
}
this.logger.log('read', this.id, this.letters, '%read_state[0]% [' + this.name + '] %read_state[1]% [' + stateText + '] ( ' + this.id + ' )');

@@ -213,7 +218,7 @@ }

{
var stateText = JSON.stringify(value), characteristics = Object.keys(this.homebridgeAccessory.context.data[this.letters]);
var stateText = JSON.stringify(value), characteristics = this.homebridgeAccessory.context.data[this.letters];
if(characteristics.length > 1)
if(Object.keys(characteristics).length > 1)
{
stateText = 'value: ' + stateText;
stateText = 'value: ' + characteristics.value;
}

@@ -236,6 +241,11 @@

if(characteristics.position != null)
if(characteristics.target != null)
{
stateText += ', position: ' + characteristics.position;
stateText += ', target: ' + characteristics.target;
}
if(characteristics.mode != null)
{
stateText += ', mode: ' + characteristics.mode;
}

@@ -284,29 +294,34 @@ this.logger.log('update', this.id, this.letters, '%update_state[0]% [' + this.name + '] %update_state[1]% [' + stateText + '] ( ' + this.id + ' )');

{
var stateText = JSON.stringify(state.value), characteristics = Object.keys(state);
var stateText = JSON.stringify(state.value);
if(characteristics.length > 1)
if(Object.keys(state).length > 1)
{
stateText = 'value: ' + stateText;
stateText = 'value: ' + state.value;
}
if(characteristics.hue != null)
if(state.hue != null)
{
stateText += ', hue: ' + characteristics.hue;
stateText += ', hue: ' + state.hue;
}
if(characteristics.saturation != null)
if(state.saturation != null)
{
stateText += ', saturation: ' + characteristics.saturation;
stateText += ', saturation: ' + state.saturation;
}
if(characteristics.brightness != null)
if(state.brightness != null)
{
stateText += ', brightness: ' + characteristics.brightness;
stateText += ', brightness: ' + state.brightness;
}
if(characteristics.position != null)
if(state.target != null)
{
stateText += ', position: ' + characteristics.position;
stateText += ', target: ' + state.target;
}
if(state.mode != null)
{
stateText += ', mode: ' + state.mode;
}
this.logger.log('read', this.id, this.letters, '%read_state[0]% [' + this.name + '] %read_state[1]% [' + stateText + '] ( ' + this.id + ' )');

@@ -313,0 +328,0 @@ }

@@ -112,4 +112,12 @@ module.exports = class TypeManager

value : { format : 'number', default : 0, min : 0, max : 100 },
position : { format : 'number', default : 0, min : 0, max : 2 }
mode : { format : 'number', default : 0, min : 0, max : 2 }
}
},
H : {
type : 'thermostat',
characteristics : {
value : { format : 'number', default : 0, min : -270, max : 100 },
target : { format : 'number', default : 4, min : 4, max : 36 },
mode : { format : 'number', default : 0, min : 0, max : 3 }
}
}

@@ -116,0 +124,0 @@ };

@@ -20,2 +20,3 @@ let PlatformAccessory, Service, UUIDGen;

const BlindService = require('./accessories/blind');
const ThermostatService = require('./accessories/thermostat');

@@ -203,2 +204,6 @@ module.exports = class UniversalAccessory

}
else if(type == 'thermostat')
{
service = new ThermostatService(this.homebridgeAccessory, this.deviceConfig, serviceConfig, this.manager);
}

@@ -205,0 +210,0 @@ if(service != null)

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