openhab-core
openhab-core copied to clipboard
[voice] Allow stop single dialogs and start dialog on an existing processor
Introduces two small changes on the Voice manager:
- Register current running single shot dialog instances so they can be stoped by the voice manager stop method.
- Allow the execution of a single of dialog processing when calling the listenAndAnswer method with the same configurations that other dialog processor running persistently.
Explanation on the second point: Before, any call to this method that collide by source id with a registered processor was rejected, but if you are using same configurations (ignoring the keyword),I think that makes sense to trigger a dialog execution with the registered dialog processor and the DialogProcessor class implementation already ensures that the keyword will be ignored while processing so there should be no problems on doing so.
Let me know if anything needs to be changed or improved.
Signed-off-by: Miguel Álvarez [email protected]
WDYT @lolodomo?
WDYT @lolodomo?
This looks like a good idea.
I must admit that my knowledge in this area is not very good.Can you explain what a "single dialog" is and what makes the difference to a "dialog"?
I must admit that my knowledge in this area is not very good.Can you explain what a "single dialog" is and what makes the difference to a "dialog"?
Sure, the dialog processor expose two different capabilities at the moment:
- Running persistently waiting for the keyword to be spotted, to fire the dialog flow (which can be simplified as: source => stt => hli => tts => sink). This is exposed through the "start dialog" VoiceManager's method. This is what we were calling dialog.
- Run just one dialog iteration (source => stt => hli => tts => sink). This is exposed through the "listen and answer" VoiceManager's method. This is what we were calling single dialog.
Let me know if some part needs further explanation @J-N-K.
Thanks
Thank you for the review.