Skip to content

Commit

Permalink
Implement fix to show the correct status of MiPlugBaseEnhanced (Issue Y…
Browse files Browse the repository at this point in the history
  • Loading branch information
yyjlincoln committed Aug 22, 2020
1 parent 7de2127 commit 13b5674
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Devices/MiPlugBaseEnhanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ MiPlugBaseEnhancedOutlet.prototype.getOutletInUse = function(callback) {
var that = this;
this.device.call("get_prop", ["power"]).then(result => {
that.platform.log.debug("[MiOutletPlatform][DEBUG]MiPlugBaseEnhanced - Outlet - getOutletInUse: " + result);
callback(null, result[0] === '100' ? true : false);
callback(null, result[0] === 'on' ? true : false);
}).catch(function(err) {
that.platform.log.error("[MiOutletPlatform][ERROR]MiPlugBaseEnhanced - Outlet - getOutletInUse Error: " + err);
callback(err);
Expand All @@ -84,7 +84,7 @@ MiPlugBaseEnhancedOutlet.prototype.getPower = function(callback) {
var that = this;
this.device.call("get_prop", ["power"]).then(result => {
that.platform.log.debug("[MiOutletPlatform][DEBUG]MiPlugBaseEnhanced - Outlet - getPower: " + result);
callback(null, result[0] === '100' ? true : false);
callback(null, result[0] === 'on' ? true : false);
}).catch(function(err) {
that.platform.log.error("[MiOutletPlatform][ERROR]MiPlugBaseEnhanced - Outlet - getPower Error: " + err);
callback(err);
Expand Down Expand Up @@ -240,4 +240,4 @@ MiPlugBaseEnhancedSwitchUSB.prototype.setUSBPower = function(value, callback) {
that.platform.log.error("[MiOutletPlatform][ERROR]MiPlugBaseEnhanced - SwitchUSB - setUSBPower Error: " + err);
callback(err);
});
}
}

0 comments on commit 13b5674

Please sign in to comment.