-
-
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
[boschindego] Rewrite to avoid external dependencies #12905
Conversation
f691991
to
f67dac7
Compare
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/boschindego-bosch-indego-binding-not-working-any-more/135825/7 |
a622be9
to
e8ffb29
Compare
Fixes openhab#12720 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Avoid reauthorization for each command/poll Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
4a717c2
to
25a11b5
Compare
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
7393433
to
592cea7
Compare
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@lolodomo, @fwolter, @Hilbrand - can one of you review this PR? I would like it to be ready for 3.3 since the binding is currently not working due to a small change in the service being used. This needed to be fixed in a library used, but unfortunately that library seems abandoned. Therefore I have replaced this by a custom implementation in the binding. Primary classes to be reviewed are
I have tested getting state and sending commands myself, and currently the binding doesn't provide any other functionality than that. After this PR I plan to add new channels providing new functionality, so this PR is to be considered a baseline and bringing the binding back to a working state. |
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.
Review part 1
...binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/DeviceStatus.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.boschindego/src/main/resources/OH-INF/i18n/boschindego.properties
Show resolved
Hide resolved
Note for myself: remains to review README and classes |
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
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.
Review part 2
...ndego/src/main/java/org/openhab/binding/boschindego/internal/handler/BoschIndegoHandler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
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.
Review last part
...ing.boschindego/src/main/java/org/openhab/binding/boschindego/internal/IndegoController.java
Outdated
Show resolved
Hide resolved
...ing.boschindego/src/main/java/org/openhab/binding/boschindego/internal/IndegoController.java
Show resolved
Hide resolved
...ing.boschindego/src/main/java/org/openhab/binding/boschindego/internal/IndegoController.java
Outdated
Show resolved
Hide resolved
...ing.boschindego/src/main/java/org/openhab/binding/boschindego/internal/IndegoController.java
Outdated
Show resolved
Hide resolved
...ing.boschindego/src/main/java/org/openhab/binding/boschindego/internal/IndegoController.java
Outdated
Show resolved
Hide resolved
...ing.boschindego/src/main/java/org/openhab/binding/boschindego/internal/IndegoController.java
Outdated
Show resolved
Hide resolved
...ing.boschindego/src/main/java/org/openhab/binding/boschindego/internal/IndegoController.java
Outdated
Show resolved
Hide resolved
...ing.boschindego/src/main/java/org/openhab/binding/boschindego/internal/IndegoController.java
Outdated
Show resolved
Hide resolved
...ing.boschindego/src/main/java/org/openhab/binding/boschindego/internal/IndegoController.java
Outdated
Show resolved
Hide resolved
...ing.boschindego/src/main/java/org/openhab/binding/boschindego/internal/IndegoController.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
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, thank you
Great! Now it works! |
@henrydiesner - good to hear, thanks. You can also try out https://drive.google.com/file/d/17xy2JwRGDcoxcDlIawjx9IDk2hzz_L8A/view?usp=sharing. It includes #12938 (partially) and #12986. |
@jlaur - now i've used the new jar file. Unfortunately I'm not able to use GET requests with my knowledge ;-( |
I'm sorry, but I don't understand what you mean - you can't use GET requests? What happens when you use the binding - can you send some debug/trace logs? This PR is now included in openHAB 3.3 released today, so if you have problems, please create an issue, and I'll look into it. |
* Rewrite to avoid external dependencies Fixes openhab#12720 * Improve session handling * Avoid reauthorization for each command/poll * Further improve session handling * Refactor SSO cookie handling * Optimize getting DeviceStatus for unknown status code Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
* Rewrite to avoid external dependencies Fixes openhab#12720 * Improve session handling * Avoid reauthorization for each command/poll * Further improve session handling * Refactor SSO cookie handling * Optimize getting DeviceStatus for unknown status code Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
* Rewrite to avoid external dependencies Fixes openhab#12720 * Improve session handling * Avoid reauthorization for each command/poll * Further improve session handling * Refactor SSO cookie handling * Optimize getting DeviceStatus for unknown status code Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk> Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
* Rewrite to avoid external dependencies Fixes openhab#12720 * Improve session handling * Avoid reauthorization for each command/poll * Further improve session handling * Refactor SSO cookie handling * Optimize getting DeviceStatus for unknown status code Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
* Rewrite to avoid external dependencies Fixes openhab#12720 * Improve session handling * Avoid reauthorization for each command/poll * Further improve session handling * Refactor SSO cookie handling * Optimize getting DeviceStatus for unknown status code Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This is an overhaul of the Bosch Indego binding in order to get rid of the dependency towards bosch-indego-controller-lib, which seems abandoned and is no longer working after Bosch made some service requirement changes. The library has been reimplemented within the binding using Jetty HTTP client for communication and GSON for JSON serialization/deserialization.
Session handling:
Set-Cookie
HTTP header when authenticating. The context is then set in aCookie
HTTP header in requests belonging to that session. This is automatically handled by Jetty.x-im-context-id
is used for sending the session context.Additional changes:
Besides these changes under the hood, no functional or breaking changes has been made.
IndegoController
contains some currently unused methods (with corresponding DTO's). They were part of the library reimplementation and will most likely be used for new features in subsequent pull requests.Fixes #7438
Fixes #12720
JAR available for testing: org.openhab.binding.boschindego-3.3.0-SNAPSHOT.jar