-
-
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
[speedtest] Binding for Ookla's Speedtest - Initial contribution #9913
Conversation
It might be an idea to merge any missing functionality into the speedtest thing that is already part of the Network Binding. 🤔 See: https://www.openhab.org/addons/bindings/network/#thing-configuration |
That is all covered in the post on the forum. I didn't do that for a reason. |
Successfully tested under Linux running OH3.0.1 in a Docker using v0.5 |
bundles/org.openhab.binding.speedtest/src/main/feature/feature.xml
Outdated
Show resolved
Hide resolved
...g.speedtest/src/main/java/org/openhab/binding/speedtest/internal/speedtestConfiguration.java
Outdated
Show resolved
Hide resolved
...peedtest/src/main/java/org/openhab/binding/speedtest/internal/speedtestBindingConstants.java
Outdated
Show resolved
Hide resolved
...binding.speedtest/src/main/java/org/openhab/binding/speedtest/internal/speedtestHandler.java
Outdated
Show resolved
Hide resolved
...binding.speedtest/src/main/java/org/openhab/binding/speedtest/internal/speedtestHandler.java
Outdated
Show resolved
Hide resolved
....speedtest/src/main/java/org/openhab/binding/speedtest/internal/speedtestHandlerFactory.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.speedtest/src/main/resources/OH-INF/i18n/speedtest_xx_XX.properties
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.speedtest/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/oh3-and-speedtest-ookla/124721/25 |
This pull request has been mentioned on openHAB Community. There might be relevant details there: |
@bigbasec When you have completed going over the suggestions please post that you have finished and want someone to take a look. |
Think everything is addressed now. |
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.
Thank you for this new binding. I have provided a few comments mostly towards the documentation.
There are some compiler warnings to check. There are also some checkstyle warnings left. You could take a look at target/code-analysis/report.html.
@openhab/add-ons-maintainers - I could use a second pair of eyes on the approach of requiring software installation on the host OS and calling an executable.
bundles/org.openhab.binding.speedtest/src/main/resources/OH-INF/i18n/speedtest.properties
Outdated
Show resolved
Hide resolved
<channel-type id="triggerTest" advanced="true"> | ||
<item-type>Switch</item-type> | ||
<label>Trigger Test</label> | ||
<description>Trigger in order to run Speedtest manually</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.
This seems like a stateless channel? In this case you could apply this policy:
<description>Trigger in order to run Speedtest manually</description> | |
<description>Trigger in order to run Speedtest manually</description> | |
<autoUpdatePolicy>veto</autoUpdatePolicy> |
See https://www.openhab.org/docs/developer/bindings/thing-xml.html#auto-update-policies
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.
veto
would be one possiblity to keep the state to OFF
even when receiving the ON
command.
Right now it is implemented in a way, that the framework sets the state to ON
and the binding sets the sate back to OFF
after the test was executed:
if (ch.equals(SpeedtestBindingConstants.TRIGGER_TEST)) {
if (command instanceof OnOffType) {
if (command == OnOffType.ON) {
getSpeed();
updateState(channelUID, OnOffType.OFF);
}
}
}
@jlaur, is there a preferred solution?
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.
Not that I'm aware of, I think both are valid solutions, and in both cases I believe you need to handle concurrent state changes (i.e. receiving ON while a speed test is already in progress).
Signed-off-by: Michael Weger <[email protected]>
Signed-off-by: Michael Weger <[email protected]>
@jlaur, compiled it in an OH4.0.0 environment and |
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.
It looks already quite nice! 👍
I also added a few minor comments.
...peedtest/src/main/java/org/openhab/binding/speedtest/internal/SpeedtestBindingConstants.java
Outdated
Show resolved
Hide resolved
...binding.speedtest/src/main/java/org/openhab/binding/speedtest/internal/SpeedtestHandler.java
Outdated
Show resolved
Hide resolved
...binding.speedtest/src/main/java/org/openhab/binding/speedtest/internal/SpeedtestHandler.java
Outdated
Show resolved
Hide resolved
...binding.speedtest/src/main/java/org/openhab/binding/speedtest/internal/SpeedtestHandler.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.speedtest/src/main/resources/OH-INF/i18n/speedtest.properties
Outdated
Show resolved
Hide resolved
@wborn - thanks for joining the review, can you help with input here? |
What kind of input? We already have some other add-ons that require software installation and that create processes to use this software:
|
...binding.speedtest/src/main/java/org/openhab/binding/speedtest/internal/SpeedtestHandler.java
Outdated
Show resolved
Hide resolved
...binding.speedtest/src/main/java/org/openhab/binding/speedtest/internal/SpeedtestHandler.java
Outdated
Show resolved
Hide resolved
That kind of input. 🙂 Thanks! I just needed confirmation that having such requirements is fine/acceptable. |
Signed-off-by: Michael Weger <[email protected]>
Signed-off-by: Michael Weger <[email protected]>
Signed-off-by: Michael Weger <[email protected]>
Signed-off-by: Michael Weger <[email protected]>
@bigbasec - there are three compiler warnings left to fix:
I'll comment one of them with a proposed solution. |
...binding.speedtest/src/main/java/org/openhab/binding/speedtest/internal/SpeedtestHandler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Michael Weger <[email protected]>
...binding.speedtest/src/main/java/org/openhab/binding/speedtest/internal/SpeedtestHandler.java
Outdated
Show resolved
Hide resolved
...binding.speedtest/src/main/java/org/openhab/binding/speedtest/internal/SpeedtestHandler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Michael Weger <[email protected]>
Signed-off-by: Michael Weger <[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 again for your contribution, @bigbasec and @MikeTheTux. LGTM!
Now, you could add your binding's logo to the openHAB website. See https://www.openhab.org/docs/developer/bindings/#add-your-binding-s-logo-to-the-openhab-website
…nhab#9913) Also-by: Brian Homeyer <[email protected]> Signed-off-by: Michael Weger <[email protected]>
The goal of this binding was to create an easy to setup speedtest option. It's fairly low frills, though should work with very limited interaction outside of the main ui.
Does require the installation of Ookla's speedtest though has been tested on Linux, Windows and openHabian without issue.
Jar file : https://github.com/bigbasec/openhab-addons/releases/download/v0.4/org.openhab.binding.speedtest-3.1.0-SNAPSHOT.jar