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

homebridge-syntex-magichome

Package Overview
Dependencies
Maintainers
1
Versions
423
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

homebridge-syntex-magichome - npm Package Compare versions

Comparing version 1.2.5-b5 to 1.2.5-b6

4

package.json
{
"name": "homebridge-syntex-magichome",
"version": "1.2.5-b5",
"version": "1.2.5-b6",
"description": "Homebridge Plugin for MagicHome LED Strips with preset scenes",

@@ -15,3 +15,3 @@ "main": "index.js",

"color-convert": "^1.5.0",
"homebridge-syntex-dynamic-platform": "1.0.8-b52"
"homebridge-syntex-dynamic-platform": "1.0.8-b57"
},

@@ -18,0 +18,0 @@ "keywords": [

@@ -56,61 +56,2 @@ const { ColoredBulbService } = require('homebridge-syntex-dynamic-platform');

updateState(state)
{
if(!this.running)
{
var changed = false;
if(state.value != null && !isNaN(state.value) && (!super.hasState('value') || this.value != state.value))
{
this.tempState.value = state.value;
super.setState(state.value,
() => this.service.getCharacteristic(this.Characteristic.On).updateValue(state.value), false);
changed = true;
}
if(state.hue != null && !isNaN(state.hue) && (!super.hasState('hue') || this.hue != state.hue))
{
this.tempState.hue = state.hue;
super.setHue(state.hue,
() => this.service.getCharacteristic(this.Characteristic.Hue).updateValue(state.hue), false);
changed = true;
}
if(state.saturation != null && !isNaN(state.saturation) && (!super.hasState('saturation') || this.saturation != state.saturation))
{
this.tempState.saturation = state.saturation;
super.setSaturation(state.saturation,
() => this.service.getCharacteristic(this.Characteristic.Saturation).updateValue(state.saturation), false);
changed = true;
}
if(state.brightness != null && !isNaN(state.brightness) && (!super.hasState('brightness') || this.brightness != state.brightness))
{
this.tempState.brightness = state.brightness;
super.setBrightness(state.brightness,
() => this.service.getCharacteristic(this.Characteristic.Brightness).updateValue(state.brightness), false);
changed = true;
}
if(changed)
{
this.logger.log('update', this.id, this.letters, '%update_state[0]% [' + this.name + '] %update_state[1]% [' + this.getStateText() + '] ( ' + this.id + ' )');
}
else
{
this.logger.log('debug', this.id, this.letters, '%update_state[0]% [' + this.name + '] %update_state[2]%! ( ' + this.id + ' )');
}
this.AutomationSystem.LogikEngine.runAutomation(this, { value : this.value, hue : this.hue, saturation : this.saturation, brightness : this.brightness });
}
}
getState(callback)

@@ -262,2 +203,53 @@ {

*/
updateState(state)
{
if(!this.running)
{
var changed = false;
if(state.value != null && !isNaN(state.value) && (!super.hasState('value') || this.value != state.value))
{
super.setState(state.value,
() => this.service.getCharacteristic(this.Characteristic.On).updateValue(state.value), false);
changed = true;
}
if(state.hue != null && !isNaN(state.hue) && (!super.hasState('hue') || this.hue != state.hue))
{
super.setHue(state.hue,
() => this.service.getCharacteristic(this.Characteristic.Hue).updateValue(state.hue), false);
changed = true;
}
if(state.saturation != null && !isNaN(state.saturation) && (!super.hasState('saturation') || this.saturation != state.saturation))
{
super.setSaturation(state.saturation,
() => this.service.getCharacteristic(this.Characteristic.Saturation).updateValue(state.saturation), false);
changed = true;
}
if(state.brightness != null && !isNaN(state.brightness) && (!super.hasState('brightness') || this.brightness != state.brightness))
{
super.setBrightness(state.brightness,
() => this.service.getCharacteristic(this.Characteristic.Brightness).updateValue(state.brightness), false);
changed = true;
}
if(changed)
{
this.logger.log('update', this.id, this.letters, '%update_state[0]% [' + this.name + '] %update_state[1]% [' + this.getStateText() + '] ( ' + this.id + ' )');
}
else
{
this.logger.log('debug', this.id, this.letters, '%update_state[0]% [' + this.name + '] %update_state[2]%! ( ' + this.id + ' )');
}
this.AutomationSystem.LogikEngine.runAutomation(this, { value : this.value, hue : this.hue, saturation : this.saturation, brightness : this.brightness });
}
}
setToCurrentColor(state, callback)

@@ -264,0 +256,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