homebridge-platform-wemo
Advanced tools
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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
14853
262
1
67
+ Addeddebug@2.2.0(transitive)
+ Addedms@0.7.1(transitive)
+ Addednode-ssdp@2.7.2(transitive)
+ Addedwemo-client@0.6.6(transitive)
- Removedasync@2.6.4(transitive)
- Removedbluebird@3.7.2(transitive)
- Removeddebug@2.6.93.2.7(transitive)
- Removedentities@1.1.2(transitive)
- Removedlodash@4.17.21(transitive)
- Removedms@2.0.02.1.3(transitive)
- Removednode-ssdp@3.3.0(transitive)
- Removedwemo-client@0.15.0(transitive)
- Removedxmlbuilder@8.2.2(transitive)
Updatedwemo-client@^0.6.1