[ondilo] Initial contribution#18914
Conversation
Signed-off-by: Michael Weger <weger.michael@gmx.net>
Signed-off-by: Michael Weger <weger.michael@gmx.net>
|
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/request-ondilo-binding/98164/7 |
Signed-off-by: Michael Weger <weger.michael@gmx.net>
Signed-off-by: Michael Weger <weger.michael@gmx.net>
|
Thanks @MikeTheTux for another contribution from you! As review capacity is somewhat limited, I would like to ask you to perform a self-review by looking at this checklist. |
Signed-off-by: Michael Weger <weger.michael@gmx.net>
|
self review completed. changes checked in ...
|
lsiepel
left a comment
There was a problem hiding this comment.
Thansk for performing the self-review. Looked at 16/23 files, will continue later or tomorrow.
bundles/org.openhab.binding.ondilo/src/main/resources/OH-INF/thing/thing-types.xml
Show resolved
Hide resolved
bundles/org.openhab.binding.ondilo/src/main/resources/OH-INF/i18n/ondilo.properties
Show resolved
Hide resolved
bundles/org.openhab.binding.ondilo/src/main/resources/OH-INF/addon/addon.xml
Show resolved
Hide resolved
...b.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloHandlerFactory.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull Request Overview
Initial contribution of a new openHAB binding for Ondilo ICO Pool and Spa monitoring devices, enabling OAuth2 integration, device discovery, and real-time data polling.
- Registers the
ondilomodule in build and feature files - Defines thing types, channels, and translations for the binding
- Implements OAuth2 bridge handler, discovery service, handlers, API client, and DTOs
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| bundles/pom.xml | Registers the org.openhab.binding.ondilo module |
| src/main/resources/OH-INF/thing/thing-types.xml | Defines bridge and device thing types with channels |
| src/main/java/org/openhab/binding/ondilo/internal/OndiloHandler.java | Handles device polling and channel updates |
| src/main/java/org/openhab/binding/ondilo/internal/OndiloApiClient.java | Implements OAuth2-enabled HTTP client for Ondilo API |
| README.md | Provides user documentation and configuration examples |
Comments suppressed due to low confidence (3)
bundles/org.openhab.binding.ondilo/README.md:76
- The example uses
mowerId, which appears copy-pasted; this should reference the pool ID parameter (e.g.,idorpoolId).
Thing ondilo "<id_received_from_discovery>" [ mowerId="<id_received_from_discovery>" ] {
bundles/org.openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloApiClient.java:56
- [nitpick] Consider adding unit tests for this method to cover HTTP request handling, response parsing, and token refresh logic.
public synchronized String get(String endpoint) {
bundles/org.openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloHandler.java:157
- List does not have a getFirst() method; use recommendations.get(0) to access the first element.
Recommendation recommendation = recommendations.getFirst();
bundles/org.openhab.binding.ondilo/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
Signed-off-by: Michael Weger <weger.michael@gmx.net>
lsiepel
left a comment
There was a problem hiding this comment.
Only the two handlers are left to review
...penhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloApiClient.java
Outdated
Show resolved
Hide resolved
...g.openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloBridge.java
Outdated
Show resolved
Hide resolved
...g.openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloBridge.java
Outdated
Show resolved
Hide resolved
...g.openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloBridge.java
Outdated
Show resolved
Hide resolved
...g.openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloBridge.java
Outdated
Show resolved
Hide resolved
lsiepel
left a comment
There was a problem hiding this comment.
Looked at the remaining files. Many small style comments, but one larger design comment about the seperation fo concerns between the pool, bridge and api classes .
...ab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloBridgeHandler.java
Outdated
Show resolved
Hide resolved
...ab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloBridgeHandler.java
Outdated
Show resolved
Hide resolved
...ab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloBridgeHandler.java
Outdated
Show resolved
Hide resolved
...ab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloBridgeHandler.java
Show resolved
Hide resolved
...ab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloBridgeHandler.java
Show resolved
Hide resolved
....openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloHandler.java
Outdated
Show resolved
Hide resolved
....openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloHandler.java
Outdated
Show resolved
Hide resolved
....openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloHandler.java
Outdated
Show resolved
Hide resolved
....openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloHandler.java
Outdated
Show resolved
Hide resolved
...ab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloOAuth2Servlet.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Michael Weger <weger.michael@gmx.net>
|
checked and fixed all editorial comments. |
Signed-off-by: Michael Weger <weger.michael@gmx.net>
Signed-off-by: Michael Weger <weger.michael@gmx.net>
Signed-off-by: Michael Weger <weger.michael@gmx.net>
Signed-off-by: Michael Weger <weger.michael@gmx.net>
Signed-off-by: Michael Weger <weger.michael@gmx.net>
Signed-off-by: Michael Weger <weger.michael@gmx.net>
|
All of the findings are fixed or commented. The main improvement which is not implemented, is the synchronization of the polling with the expected measure time. Right now, all Things are updated via a single poll-function, ensuring the API rate limit. Polling per Thing would complicate things again ... |
Signed-off-by: Michael Weger <weger.michael@gmx.net>
|
5ae9efb implements:
|
Signed-off-by: Michael Weger <weger.michael@gmx.net>
added API to validate recommendations Signed-off-by: Michael Weger <weger.michael@gmx.net>
lsiepel
left a comment
There was a problem hiding this comment.
Thanks for addressing the issues quickly. Besides the comment you had, i also want to add that whenever there is a transient error in the http communcation (like a timeout) the binding does not have some kind of retry mechanism. This might be fine as the polling is rather slow it might also have a big impact.
...g.openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloBridge.java
Show resolved
Hide resolved
....openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloHandler.java
Outdated
Show resolved
Hide resolved
....openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloHandler.java
Outdated
Show resolved
Hide resolved
...penhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/dto/LastMeasure.java
Outdated
Show resolved
Hide resolved
...s/org.openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/dto/Pool.java
Outdated
Show resolved
Hide resolved
....openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloHandler.java
Outdated
Show resolved
Hide resolved
....openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloHandler.java
Show resolved
Hide resolved
....openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloHandler.java
Outdated
Show resolved
Hide resolved
....openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloHandler.java
Outdated
Show resolved
Hide resolved
....openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloHandler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Michael Weger <weger.michael@gmx.net>
|
If you are able to fix the open comments before 16:00 it might be part of oh5. Otherwise i'm not sure. |
Signed-off-by: Michael Weger <weger.michael@gmx.net>
lsiepel
left a comment
There was a problem hiding this comment.
Thanks for this binding and the quick follow-ups. While there are some minor things to fix, we need to merge now due to the feature freezen. Please create a follow-up PR for post fixes like the warning: #18914 (comment)
LGTM
Now, you could add the binding's logo to the openHAB website. See https://www.openhab.org/docs/developer/addons/#add-your-add-on-s-logo-to-the-openhab-website
* inital checkin of skeleton Signed-off-by: Michael Weger <weger.michael@gmx.net>
* inital checkin of skeleton Signed-off-by: Michael Weger <weger.michael@gmx.net> Signed-off-by: Paul Smedley <paul@smedley.id.au>
[ondilo] Initial contribution
Description
New openHAB binding for Ondilo ICO Pool and Spa monitoring devices, allowing to monitor and automate a pool environment using openHAB’s rules and UI.