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

[tr064] add rule action for phonebook #9505

Merged
merged 2 commits into from
Dec 28, 2020
Merged

[tr064] add rule action for phonebook #9505

merged 2 commits into from
Dec 28, 2020

Conversation

J-N-K
Copy link
Member

@J-N-K J-N-K commented Dec 24, 2020

Closes #9492

Signed-off-by: Jan N. Klug [email protected]

@J-N-K J-N-K added enhancement An enhancement or new feature for an existing add-on rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Dec 24, 2020

`String name = phonebookLookup(String number, String phonebook, int matchCount)`

`phonebook` and `matchCount` are optional parameters.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested those changes and based on the description here would have expected that something like

val tr064Actions = getActions("tr064","tr064:fritzbox:2a28aee1ee")
val result = tr064Actions.phonebookLookup("01234567")

would actually work as the other parameters are described as optional.

But the above rule code results in an error like

Script execution of rule with UID 'fritzbox' failed: An error occurred during the script execution: index=3, size=3 in fritzbox

Using val result = tr064Actions.phonebookLookup("01234567", null, null) works fine. Maybe might be good to update the readme here, so it's clear the parameters can't be ommited, but need to be set to null instead - or update the code if the parameters should be ommitable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably adding those methods would be the better option. Will do that tomorrow. Is it working otherwise as expected?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only did some simple lookups of incoming call numbers in the phonebook. That worked as expected. But didn't test (yet) if the phonebook and matchCount parameters are working correctly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested looking up with specific phonebooks. Seems to work as expected. But might be useful to mention it's selected by the phonebooks name (and not its id)

Signed-off-by: Jan N. Klug <[email protected]>
Copy link
Contributor

@cpmeister cpmeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cpmeister cpmeister added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Dec 28, 2020
@cpmeister cpmeister merged commit 06690bd into openhab:main Dec 28, 2020
@cpmeister cpmeister added this to the 3.1 milestone Dec 28, 2020
@J-N-K J-N-K deleted the tr064 branch December 28, 2020 18:09
seaside1 pushed a commit to seaside1/openhab-addons that referenced this pull request Dec 28, 2020
* add rule action for phonebook
* address review comments

Signed-off-by: Jan N. Klug <[email protected]>
seaside1 pushed a commit to seaside1/openhab-addons that referenced this pull request Dec 28, 2020
* add rule action for phonebook
* address review comments

Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Joseph Hagberg <[email protected]>
thinkingstone pushed a commit to thinkingstone/openhab-addons that referenced this pull request Nov 7, 2021
* add rule action for phonebook
* address review comments

Signed-off-by: Jan N. Klug <[email protected]>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this pull request May 5, 2022
* add rule action for phonebook
* address review comments

Signed-off-by: Jan N. Klug <[email protected]>
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 for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[tr064] Add phonebook resolving action
3 participants