Skip to content

Commit

Permalink
Allow to enable only certain speechhandlers by configuration (#176)
Browse files Browse the repository at this point in the history
Thanks for pointing out about the master/naomi-dev change with the readme.

I just tested and both this:
`speechhandlers: ["life","clock","Shutdown","joke","unclear"]`
and this:
```
speechhandlers:
  life
  clock
  Shutdown
  joke
  unclear
```
work. The second looks odd and I'm not sure it's proper yaml but it works.
  • Loading branch information
sbernhard authored and aaronchantrill committed Apr 11, 2019
1 parent 8518f93 commit 03cc6a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion naomi/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ def __init__(
exc_info=(
self._logger.getEffectiveLevel() == logging.DEBUG))
else:
self.brain.add_plugin(plugin)
if 'speechhandlers' not in self.config or info.name in self.config['speechhandlers']:
self._logger.info('Activate speechhandler plugin %s', info.name)
self.brain.add_plugin(plugin)

if len(self.brain.get_plugins()) == 0:
msg = 'No plugins for handling speech found!'
Expand Down

0 comments on commit 03cc6a5

Please sign in to comment.