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

homebridge-platform-wemo

Package Overview
Dependencies
Maintainers
1
Versions
357
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

homebridge-platform-wemo - npm Package Compare versions

Comparing version 0.5.6 to 0.5.7

37

index.js

@@ -106,14 +106,10 @@ /* jshint node: true */

// set onState for convenience from capabilities
// this does not however appear to be very reliable but thats an Belkin issue
this.onState = (this._capabilities['10006'].substr(0,1) === '1') ? true : false ;
this.log("%s is %s", this.name, this.onState);
var self = this;
// set brightness for convenience.
// this does not however appear to be very reliable but thats an Belkin issue
this.brightness = Math.round(this._capabilities['10008'].split(':').shift() / 255 * 100 );
this.log("%s is %s bright", this.name, this.brightness);
// we can't depend on the capabilities returned from Belkin so we'll go ask expliciitly.
this.getStatus(function (err) {
self.onState = (self._capabilities['10006'].substr(0,1) === '1') ? true : false ;
self.log("%s is %s", self.name, self.onState);
self.brightness = Math.round(self._capabilities['10008'].split(':').shift() / 255 * 100 );
self.log("%s is %s bright", self.name, self.brightness);
});
// register eventhandler

@@ -286,2 +282,19 @@ this._client.on('statusChange', function(deviceId, capabilityId, value) {

WemoAccessory.prototype.getStatus = function (cb) {
// this function is called on initialisation of a Bulbas we can't rely on Belkin's
// capabilities structure on initialisation
var self = this;
this._client.getDeviceStatus(this.enddevice.deviceId, function (err, capabilities) {
if(err) {
if(cb) {cb("unknown error getting device status (getStatus)", capabilities)}
}
else {
// convert string of capabilities and values to arrays.
self._capabilities = capabilities;
self.log("getStatus: %s is ", self.name, capabilities);
if (cb) { cb(null) }
}
});
}
WemoAccessory.prototype.setOnStatus = function (value, cb) {

@@ -288,0 +301,0 @@ // var client = wemo.client(this.device);

{
"name": "homebridge-platform-wemo",
"version": "0.5.6",
"version": "0.5.7",
"description": "WeMo Platform plugin for homebridge - Blubs, Switches and Insight Switches Supported",

@@ -5,0 +5,0 @@ "license": "ISC",

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