-
-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[voice] Support item descriptions in built-in interpreter. #3853
Conversation
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
I have added basic support for custom rules using the item metadata in the last commit. Let me know if it's better to move that to another PR. If it's ok to merge these changes I would like to remove the actiontemplateinterpreter from the addons repo afterwards. Best regards. |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/dialog-processing-with-the-pulseaudiobinding/148191/1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, quite some code changes, which isn't easy to review, but scanning through it, it lgtm, so let's merge!
So we have to suppress actiontemplatehli now? |
Oh, I was not notified about these messages, thank you for accepting the PR! I been using it for some weeks and it worked great. The only thing I doubt about is whether was a good idea or not to register the rules for every item with state/command description or if it would be a better idea to require a flag provided through the introduced metadata key 'voice-system', because for me it works fast but maybe in a system with a great amount of items it can affect the performance. But it's something easy to change if needed. I have another minor idea for allowing creating itemRules using an item as template, I need to give it a try, then I can try to document the full functionality somewhere if you want.
@lolodomo, yes, I would like to do so, I can create the PR if you want me to do it. |
Yes please |
Refs openhab/openhab-core#3925, openhab/openhab-core#3897 and openhab/openhab-core#3853. --------- Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
Hello OpenHAB's maintainers, I would like to merge the following changes in the voice bundle.
It enables support in the standard interpreter to use the item StateDescription/CommandDescription labels to update them in the current available languages.
As an example:
If you have a dimmer item labeled as
Brightness
with command description50=normal
, the commandset brightness to normal
will be handled and send a PercentageType command with value 50 to the item.French and German command needs to be reviewed, I made them by coping the color command or using a translator.
It introduces a minor behavior change, if the language (a locale instance) is provided only the rules for that language are loaded. I think it's the correct thing to do in order to avoid register rules you are not going to use, but I can revert that part if you think it can have any side effect.
Tested in the 4.1.0.M2, seems to work great.