-
-
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
[cloudrain] Initial contribution #11239
Conversation
Initial contribution for a Cloudrain binding (https://cloudrain.de) Signed-off-by: Till Koellmann <[email protected]> Signed-off-by: tikoell <[email protected]>
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.
Thanks for the submission, once you have done these I will take another look. Whilst waiting, please also go into the \target\code-analysis folder and read the report and fix anything in there.
....binding.cloudrain/src/main/java/org/openhab/binding/cloudrain/internal/CloudrainConfig.java
Show resolved
Hide resolved
...drain/src/main/java/org/openhab/binding/cloudrain/internal/handler/CloudrainZoneHandler.java
Outdated
Show resolved
Hide resolved
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.
Hey,
thanks for your contribution!
Code looks good, there are just some typos and smaller remarks.
Due this was my first code review for openhab-addons and i'm not (yet) familiar with all the things around in the
openhab-environment, i've just finished the review as comment, so feel free to skip some remarks, if they don't make sense to you.
...drain/src/main/java/org/openhab/binding/cloudrain/internal/handler/CloudrainZoneHandler.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.cloudrain/src/main/resources/OH-INF/thing/thing-types.xml
Show resolved
Hide resolved
...drain/src/main/java/org/openhab/binding/cloudrain/internal/handler/CloudrainZoneHandler.java
Outdated
Show resolved
Hide resolved
....binding.cloudrain/src/main/java/org/openhab/binding/cloudrain/internal/CloudrainConfig.java
Show resolved
Hide resolved
...loudrain/src/main/java/org/openhab/binding/cloudrain/internal/CloudrainBindingConstants.java
Outdated
Show resolved
Hide resolved
Thanks for the reviews! I will incorporate the changes by end of next week. |
Signed-off-by: Till Koellmann <[email protected]>
Signed-off-by: Till Koellmann <[email protected]>
Hi, thanks for the reviews. I fixed all findings and commented on your questions. Please have a look again. Thanks! |
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.
Here comes my review feedback. @Skinah and @soenkekueper already did a good job!
| duration | Integer | The total duration in seconds of an active irrigation. NULL if no irrigation is active. | | ||
| remainingSeconds | Integer | The remaining duration in seconds of an active irrigation. NULL if no irrigation is active. | |
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.
You could use Units of Measure.
Also, Integer
is not a valid Item type.
| duration | Integer | The total duration in seconds of an active irrigation. NULL if no irrigation is active. | | |
| remainingSeconds | Integer | The remaining duration in seconds of an active irrigation. NULL if no irrigation is active. | | |
| duration | Number:Time | The total duration in seconds of an active irrigation. NULL if no irrigation is active. | | |
| remainingSeconds | Number:Time | The remaining duration in seconds of an active irrigation. NULL if no irrigation is active. | |
// Register the zone to receive irrigation updates only if channels are linked | ||
// This is done to avoid unnecessary frequent API calls | ||
if (isAnyIrrigationChannelLinked()) { | ||
handler.registerForIrrigationUpdates(zoneId, getThing()); | ||
} |
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.
You could do this more easily without retrieving the registry.
getThing().getChannels().stream().filter(channel -> isLinked(channel.getUID())).findAny().isPresent();
@Override | ||
public void handleRemoval() { | ||
super.handleRemoval(); | ||
unregisterAll(); | ||
} |
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.
What's the reason for implementing this method?
...drain/src/main/java/org/openhab/binding/cloudrain/internal/handler/CloudrainZoneHandler.java
Show resolved
Hide resolved
xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> | ||
|
||
<name>Cloudrain Binding</name> | ||
<description>This is the binding for the Cloudrain system.</description> |
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.
Could you be a bit more verbose, so that somebody who hasn't heard about it gets a clue what this is about?
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.
This needs to be adapted to the new addon.xml
, the PR to adapt the developer docs is not merged yet, so if you need more details, the corresponding issue is here: openhab/openhab-core#2058
But you can also update your branch and look at another binding's addon.xml
and adapt it to this initial contribution.
bundles/org.openhab.binding.cloudrain/src/main/resources/OH-INF/thing/thing-types.xml
Show resolved
Hide resolved
@Tikoell What's the status of this PR? |
<parent> | ||
<groupId>org.openhab.addons.bundles</groupId> | ||
<artifactId>org.openhab.addons.reactor.bundles</artifactId> | ||
<version>3.2.0-SNAPSHOT</version> |
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.
<version>3.2.0-SNAPSHOT</version> | |
<version>4.2.0-SNAPSHOT</version> |
@@ -0,0 +1,17 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" | |||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
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.
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
See #11833
Hi @Tikoell are you planning to proceed with this PR? it has been around here for quite some time now and i'm happy to review or help you out, but if you can't proceed, it might be better to just close this. |
Unfortunately it looks like we cannot bring this PR to the finish line. After two years of inactivity i close this PR. If there is a need to restart, feel free to re-open or start a new PR. |
Initial contribution for a new Cloudrain binding.
Cloudrain offers a smart irrigation system which uses weather data to optimize irrigation schedules. The binding allows you to integrate, view and control Cloudrain devices in the openHAB environment with the help of the Cloudrain Developer API.
Link to the jar file
Link to the source
Signed-off-by: Till Koellmann [email protected]