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.5 to 0.5.6

31

index.js

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

this.brightness = null;
this._internalState = enddevice.internalState;
this._capabilities = enddevice.capabilities;
// set onState for convenience
this.onState = (this._internalState['10006'].substr(0,1) === '1') ? true : false ;
this.log("%s is %s", this.name, this.onState, this._internalState['10006'].substr(0,1));
// 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.brightness = Math.round(this._internalState['10008'].split(':').shift() / 255 * 100 );
// 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);

@@ -185,10 +189,11 @@

this.log('statusChange: %s', deviceId, capabilityId, value);
this._internalState[capabilityId] = value;
this._capabilities[capabilityId] = value;
if (capabilityId ==='10008') {
this.brightness = Math.round(this._internalState['10008'].split(':').shift() / 255 * 100 );
this._internalState['10006'] = '1'; //changing wemo bulb brightness always turns them on so lets reflect this!
this.brightness = Math.round(this._capabilities['10008'].split(':').shift() / 255 * 100 );
// this.setOnStatus('1');
this._capabilities['10006'] = '1'; //changing wemo bulb brightness always turns them on so lets reflect this!
}
this.onState = (this._internalState['10006'].substr(0,1) === '1') ? true : false;
this.onState = (this._capabilities['10006'].substr(0,1) === '1') ? true : false;
}

@@ -264,5 +269,7 @@

// var client = wemo.client(this.device);
this.log("setOn: %s to %s", this.name, value);
this._client.setBinaryState(value ? 1 : 0);
this.onState = value;
if (this.onState != value) { //remove redundent calls to setBinaryState when requested state is already achieved
this.log("setOn: %s to %s", this.name, value);
this._client.setBinaryState(value ? 1 : 0);
this.onState = value;
}
if (cb) cb(null);

@@ -269,0 +276,0 @@ }

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

@@ -22,4 +22,4 @@ "license": "ISC",

"request": "^2.65.0",
"wemo-client": "*"
"wemo-client": "^0.6.1"
}
}

@@ -8,5 +8,6 @@ # homebridge-platform-wemo

- Wemo Light Swicth
- Wemo Insight Switch (on/off only)
- Wemo Insight Switch (on/off/outlineinuse only)
- Wemo Bulb (via Wemo Link - on/off/brightness)
- Wemo Motion
- Wemo NetCam (Sensor)

@@ -29,5 +30,9 @@ # Installation

`expected_accessories` is the count of Wemo bulbs and switches you have - it is optional and if not specified the `timeout` value will be used to wait for the discovery process to conclude.
`timeout` is specified in seconds and will default to 10 seconds.
`expected_accessories` is **optional**, defaults to unlimited and is the total count of Wemo bulbs, switches, etc that we will try to find. It essentially shrtcuts the `timeout` value - i.e. if we find the specified number of accessories we'l not bother with the timeout.
`timeout` is **optional**, defaults to 10 and if specified, in seconds, defines how long we will wait to find the specified number of `expected_accessories`
`no_motion_timer` is optional, defaults to 60 and applies to WeMo Motion Only. It is a timer in seconds for how long after motion is not detected that the state is changed.
```javascript

@@ -38,4 +43,5 @@ "platforms": [

"name": "WeMo Platform",
"expected_accessories" : "x",
"timeout" : "y"
"expected_accessories" : "0",
"timeout" : "25",
"no_motion_timer": "60"
}

@@ -59,2 +65,3 @@ ]

- Andy Lindeman for the [homebridge-smartthings](https://github.com/alindeman/homebridge-smartthings) that this is work is based on.
- [David Perry](https://github.com/devbobo) for his contributions.

@@ -61,0 +68,0 @@ # License

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