Skip to content
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

Merged
merged 2 commits into from
Nov 7, 2023

Conversation

GiviMAD
Copy link
Member

@GiviMAD GiviMAD commented Oct 19, 2023

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 description 50=normal, the command set 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.

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
@GiviMAD GiviMAD requested a review from a team as a code owner October 19, 2023 20:26
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
@GiviMAD
Copy link
Member Author

GiviMAD commented Oct 20, 2023

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.

@openhab-bot
Copy link
Collaborator

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

Copy link
Member

@kaikreuzer kaikreuzer left a 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!

@kaikreuzer kaikreuzer merged commit ade5312 into openhab:main Nov 7, 2023
2 checks passed
@kaikreuzer kaikreuzer added the enhancement An enhancement or new feature of the Core label Nov 7, 2023
@kaikreuzer kaikreuzer added this to the 4.1 milestone Nov 7, 2023
@lolodomo
Copy link
Contributor

I would like to remove the actiontemplateinterpreter from the addons repo afterwards.

So we have to suppress actiontemplatehli now?

@GiviMAD
Copy link
Member Author

GiviMAD commented Nov 26, 2023

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.

So we have to suppress actiontemplatehli now?

@lolodomo, yes, I would like to do so, I can create the PR if you want me to do it.

@lolodomo
Copy link
Contributor

yes, I would like to do so, I can create the PR if you want me to do it.

Yes please

florian-h05 pushed a commit to openhab/openhab-webui that referenced this pull request Dec 17, 2023
Refs openhab/openhab-core#3925,
openhab/openhab-core#3897 and
openhab/openhab-core#3853.

---------

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants