Skip to content

Commit

Permalink
Merge pull request #14 from fewieden/develop
Browse files Browse the repository at this point in the history
bugfix 1.0.2
  • Loading branch information
fewieden authored Jun 7, 2017
2 parents 8bd01d2 + eb01641 commit 7db59d7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# MMM-voice Changelog

## [1.0.2]

### Fixed

* Restored context for handleData, logDebug and logError
* DeprecationWarning: Calling async function without callback (noop function)

## [1.0.1]

### Added
Expand Down
20 changes: 13 additions & 7 deletions node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,20 @@ module.exports = NodeHelper.create({

this.startPocketsphinx();

fs.unlink(`${filename}.log_pronounce`);
fs.unlink(`${filename}.sent`);
fs.unlink(`${filename}.vocab`);
fs.unlink(`TAR${filename}.tgz`);
fs.unlink(`${filename}.log_pronounce`, this.noOp);
fs.unlink(`${filename}.sent`, this.noOp);
fs.unlink(`${filename}.vocab`, this.noOp);
fs.unlink(`TAR${filename}.tgz`, this.noOp);
}
});
},

/**
* @function noOp
* @description Performs no operation.
*/
noOp() {},

/**
* @function startPocketsphinx
* @description Starts Pocketsphinx binary.
Expand All @@ -225,13 +231,13 @@ module.exports = NodeHelper.create({
microphone: this.config.microphone
});

this.ps.on('data', this.handleData);
this.ps.on('data', this.handleData.bind(this));

if (this.config.debug) {
this.ps.on('debug', this.logDebug);
this.ps.on('debug', this.logDebug.bind(this));
}

this.ps.on('error', this.logError);
this.ps.on('error', this.logError.bind(this));

this.sendSocketNotification('READY');
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mmm-voice",
"version": "1.0.1",
"version": "1.0.2",
"description": "Voice Recognition Module for MagicMirror2",
"scripts": {
"lint": "./node_modules/.bin/eslint . && ./node_modules/.bin/stylelint .",
Expand Down

0 comments on commit 7db59d7

Please sign in to comment.