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

[pushover] Mandatory title in messages #9279

Closed
DanielMalmgren opened this issue Dec 7, 2020 · 5 comments
Closed

[pushover] Mandatory title in messages #9279

DanielMalmgren opened this issue Dec 7, 2020 · 5 comments
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@DanielMalmgren
Copy link

DanielMalmgren commented Dec 7, 2020

According to the documentation at http://next.openhab.org/addons/bindings/pushover/ the second argument to sendMessage() should be optional, but when trying to call the method with only one argument I get the following error:

Invalid number of arguments. The method sendMessage(ThingActions, String, String) is not applicable for the arguments (ThingActions,String);

When providing two arguments (message and title) everything works as it should.

This is the version of the binding provided in 3.0 M5.

@DanielMalmgren DanielMalmgren added the bug An unexpected problem or unintended behavior of an add-on label Dec 7, 2020
@cweitkamp
Copy link
Contributor

Yes, that is right. But adding hundreds of methods to cover all possible combinations of parameters is not a good design. As stated in #8586 (comment) I would rather investigate on exposing the message builder which is way more flexible and a basic pattern.

@DanielMalmgren
Copy link
Author

Oh, wait. I think this might be my fault. I interpreted the "@nullable" in the documentation as the second argument being optional, but it isn't, is it? I guess that means I have to provide the argument anyway, just that it can be null?

(btw, I wonder what happened to the link to the documentation that I put in this ticket, it certainly doesn't link to the place it should...)

@wborn
Copy link
Member

wborn commented Dec 8, 2020

(btw, I wonder what happened to the link to the documentation that I put in this ticket, it certainly doesn't link to the place it should...)

It was:

[http://next.openhab.org/addons/bindings/pushover/](url)

But it should have been used like:

[Pushover Documentation](http://next.openhab.org/addons/bindings/pushover/)

Pushover Documentation

If you don't want to provide a text for the link... just post the link 😉

@wborn
Copy link
Member

wborn commented Dec 8, 2020

Oh, wait. I think this might be my fault. I interpreted the "@nullable" in the documentation as the second argument being optional, but it isn't, is it? I guess that means I have to provide the argument anyway, just that it can be null?

Yes you still need to provide a null parameter value for @Nullable values.

@DanielMalmgren
Copy link
Author

Understood. Guess I'll close this ticket then. I guess the documentation could be a little bit more clear, but maybe it is for people in the world of Java :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

No branches or pull requests

3 participants