forked from platypush/platypush
An AssistantEvent
should not fail initialization if the assistant integration isn't found.
This commit is contained in:
parent
04b1dad6d8
commit
c690230930
2 changed files with 7 additions and 10 deletions
|
@ -17,15 +17,12 @@ class AssistantEvent(Event):
|
|||
if assistant:
|
||||
self._assistant = assistant
|
||||
else:
|
||||
self._assistant = get_backend('assistant.google')
|
||||
|
||||
if not self._assistant:
|
||||
self._assistant = get_plugin('assistant.google.pushtotalk')
|
||||
|
||||
if not self._assistant:
|
||||
self.logger.warning(
|
||||
'Assistant plugin/backend not configured/initialized'
|
||||
)
|
||||
try:
|
||||
self._assistant = get_backend('assistant.google')
|
||||
if not self._assistant:
|
||||
self._assistant = get_plugin('assistant.google.pushtotalk')
|
||||
except Exception as e:
|
||||
self.logger.debug('Could not initialize the assistant component: %s', e)
|
||||
self._assistant = None
|
||||
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ def test_speech_recognized_event_parse():
|
|||
assert 'answer' in result.parsed_args
|
||||
assert result.parsed_args['answer'] == '42'
|
||||
|
||||
event = PingEvent(phrase="what is not the answer? 43")
|
||||
event = SpeechRecognizedEvent(phrase="what is not the answer? 43")
|
||||
result = event.matches_condition(condition)
|
||||
assert not result.is_match
|
||||
|
||||
|
|
Loading…
Reference in a new issue