-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[http] Initial contribution #8521
Conversation
Hey @J-N-K, TravisCI finished with status TravisBuddy Request Identifier: 95074880-04e0-11eb-a4bc-1b94c014fd22 |
PR build asks you to apply spotless to the pom.xml. |
...ing.http/src/main/java/org/openhab/binding/http/internal/converter/GenericItemConverter.java
Outdated
Show resolved
Hide resolved
....binding.http/src/main/java/org/openhab/binding/http/internal/http/HttpResponseListener.java
Outdated
Show resolved
Hide resolved
....binding.http/src/main/java/org/openhab/binding/http/internal/http/HttpResponseListener.java
Outdated
Show resolved
Hide resolved
fe05dc6
to
0e23276
Compare
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
@openhab/add-ons-maintainers Can we get a second review here? Would be great to have this in M3, so people using http1 can move on to OH3 |
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.
Good code in general. I'm not aware of the current null check implementations, but I receive 3 warnings when compiling with maven.
I don't really like that you use unchecked exceptions all over the code, because the compiler doesn't enforce you to catch those. Normally I would claim this as error prone, but I think you know what you're doing.
|
||
| parameter | optional | default | description | | ||
|-------------------------|----------|-------------|-------------| | ||
| `onValue` | yes | - | A special value that represents `ON` | |
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.
By reading the documentation I don't understand what these special values are about. Are they searched in the response body respectively sent in the body?
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.
If the response (after transformation) is equal to that value, it is interpreted as ON
(e.g. a response could be true
, 1
or eingeschalltet
).
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.
Can you put this sentence in the readme? I think it would help the user to understand how this binding is actually working, as you don't provide examples.
When thinking about how this works, I also wouldn't know what to set the transformation parameters to. I think a full example would be really helpful.
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.
I added a note for the special values and also examples for the transformation
....binding.http/src/main/java/org/openhab/binding/http/internal/http/HttpResponseListener.java
Outdated
Show resolved
Hide resolved
....binding.http/src/main/java/org/openhab/binding/http/internal/http/HttpResponseListener.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.http/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.http/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.http/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
Regarding the checked/unchecked exceptions: Unfortunately an unchecked exception leads to a better code style.
is not possible if |
|
||
| parameter | optional | default | description | | ||
|-------------------------|----------|-------------|-------------| | ||
| `onValue` | yes | - | A special value that represents `ON` | |
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.
Can you put this sentence in the readme? I think it would help the user to understand how this binding is actually working, as you don't provide examples.
When thinking about how this works, I also wouldn't know what to set the transformation parameters to. I think a full example would be really helpful.
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
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.
LGTM
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This adds a new HTTP binding as a replacement for the old http1 binding.
Replaces #7851
Signed-off-by: Jan N. Klug jan.n.klug@rub.de