Skip to content

Commit

Permalink
Restoring use of _report for motion sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
aholstenson committed Jan 25, 2018
1 parent 465e319 commit 67865ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 4 additions & 5 deletions lib/devices/gateway/motion.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ module.exports = class extends SubDevice.with(Motion, Voltage) {

this.updateMotion(false);

this.defineProperty('status');
}

propertyChanged(key, value, oldValue) {
if(key === 'status' && value === 'motion') {
_report(data) {
super._report(data);

if(typeof data.status !== 'undefined' && data.status === 'motion') {
this.updateMotion(true, '1m');
}

super.propertyChanged(key, value, oldValue);
}
};
8 changes: 4 additions & 4 deletions lib/devices/gateway/motion2.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ module.exports = class extends SubDevice.with(Motion, Illuminance, Voltage) {
});
}

propertyChanged(key, value, oldValue) {
if(key === 'status' && value === 'motion') {
_report(data) {
super._report(data);

if(typeof data.status !== 'undefined' && data.status === 'motion') {
this.updateMotion(true, '1m');
}

super.propertyChanged(key, value, oldValue);
}
};

0 comments on commit 67865ec

Please sign in to comment.