-
-
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
[dominoswiss] Initial contribution #11585
Conversation
Signed-off-by: Frieso Aeschbacher <[email protected]>
Signed-off-by: Frieso Aeschbacher <[email protected]>
Signed-off-by: Frieso Aeschbacher <[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.
There's one checkstyle warning left.
...binding.dominoswiss/src/main/java/org/openhab/binding/dominoswiss/internal/EGateHandler.java
Outdated
Show resolved
Hide resolved
localSocket.connect(new InetSocketAddress(host, port)); | ||
localSocket.setSoTimeout(SOCKET_TIMEOUT_SEC); | ||
BufferedWriter localWriter = writer; | ||
localWriter = new BufferedWriter(new OutputStreamWriter(localSocket.getOutputStream())); |
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 need to close the BufferedWriter. You could use the auto-close feature:
localWriter = new BufferedWriter(new OutputStreamWriter(localSocket.getOutputStream())); | |
try(localWriter = new BufferedWriter(new OutputStreamWriter(localSocket.getOutputStream()))) { |
If I see correctly, you create new BufferedWriter/OutputStreamWriter each poll. Why not create one when connecting and close it in dispose() or disconnect? Then, you can also re-use it in sendCommand().
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 close the BufferedWriter. The redesign will be made with a later release, thanks for that hint.
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.
The BufferedWriter is assigned to the local variable localWriter
, but this variable is out of scope if the method pollingConfig
is left. So, the BufferedWrite is never closed and you will end up with a resource leak.
As said, the assignment BufferedWriter localWriter = writer;
has no effect.
Signed-off-by: Frieso Aeschbacher <[email protected]>
Signed-off-by: Frieso Aeschbacher <[email protected]>
419e978
to
6edcb5d
Compare
Signed-off-by: Frieso Aeschbacher <[email protected]>
Signed-off-by: Fabian Wolter <[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.
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
Dear @fwolter thanks a lot for your support and your input to bring the binding to the desired quality level :) A big thank you and cheers |
* Added Dominoswiss to CODEOWNERS and POMs Signed-off-by: Frieso Aeschbacher <[email protected]> * Intitial contribution of Dominoswiss Binding Signed-off-by: Frieso Aeschbacher <[email protected]> * Typo in pom.xml Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed inputs from fwolter Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed inputs from fwolter Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed localWriter Issue Signed-off-by: Frieso Aeschbacher <[email protected]> * Update bom/openhab-addons/pom.xml Signed-off-by: Fabian Wolter <[email protected]> Co-authored-by: Fabian Wolter <[email protected]> Signed-off-by: Nick Waterton <[email protected]>
* Added Dominoswiss to CODEOWNERS and POMs Signed-off-by: Frieso Aeschbacher <[email protected]> * Intitial contribution of Dominoswiss Binding Signed-off-by: Frieso Aeschbacher <[email protected]> * Typo in pom.xml Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed inputs from fwolter Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed inputs from fwolter Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed localWriter Issue Signed-off-by: Frieso Aeschbacher <[email protected]> * Update bom/openhab-addons/pom.xml Signed-off-by: Fabian Wolter <[email protected]> Co-authored-by: Fabian Wolter <[email protected]> Signed-off-by: Michael Schmidt <[email protected]>
* Added Dominoswiss to CODEOWNERS and POMs Signed-off-by: Frieso Aeschbacher <[email protected]> * Intitial contribution of Dominoswiss Binding Signed-off-by: Frieso Aeschbacher <[email protected]> * Typo in pom.xml Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed inputs from fwolter Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed inputs from fwolter Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed localWriter Issue Signed-off-by: Frieso Aeschbacher <[email protected]> * Update bom/openhab-addons/pom.xml Signed-off-by: Fabian Wolter <[email protected]> Co-authored-by: Fabian Wolter <[email protected]>
* Added Dominoswiss to CODEOWNERS and POMs Signed-off-by: Frieso Aeschbacher <[email protected]> * Intitial contribution of Dominoswiss Binding Signed-off-by: Frieso Aeschbacher <[email protected]> * Typo in pom.xml Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed inputs from fwolter Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed inputs from fwolter Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed localWriter Issue Signed-off-by: Frieso Aeschbacher <[email protected]> * Update bom/openhab-addons/pom.xml Signed-off-by: Fabian Wolter <[email protected]> Co-authored-by: Fabian Wolter <[email protected]>
* Added Dominoswiss to CODEOWNERS and POMs Signed-off-by: Frieso Aeschbacher <[email protected]> * Intitial contribution of Dominoswiss Binding Signed-off-by: Frieso Aeschbacher <[email protected]> * Typo in pom.xml Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed inputs from fwolter Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed inputs from fwolter Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed localWriter Issue Signed-off-by: Frieso Aeschbacher <[email protected]> * Update bom/openhab-addons/pom.xml Signed-off-by: Fabian Wolter <[email protected]> Co-authored-by: Fabian Wolter <[email protected]>
* Added Dominoswiss to CODEOWNERS and POMs Signed-off-by: Frieso Aeschbacher <[email protected]> * Intitial contribution of Dominoswiss Binding Signed-off-by: Frieso Aeschbacher <[email protected]> * Typo in pom.xml Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed inputs from fwolter Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed inputs from fwolter Signed-off-by: Frieso Aeschbacher <[email protected]> * Fixed localWriter Issue Signed-off-by: Frieso Aeschbacher <[email protected]> * Update bom/openhab-addons/pom.xml Signed-off-by: Fabian Wolter <[email protected]> Co-authored-by: Fabian Wolter <[email protected]> Signed-off-by: Andras Uhrin <[email protected]>
Added new Binding "org.openhab.binding.dominoswiss" for a first initial commit of this binding
[dominoswiss][WIP] initial contribution
added new binding org.openhab.binding.dominoswiss for initial commit
This binding allows the controll of rollershutters, using an egate as gateway and dominoswiss radio receivers. The egate-gateway is connectet via ethernet to openhab and sends it's commands via radio to all rollershutters.
Announcement: https://community.openhab.org/t/announce-dominoswiss-binding/76503
Replaces Pull-Request #9837
Jar-File for Testing:
https://github.com/Friesoch/org.openhab.binding.dominoswiss