Skip to content
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

Merged
merged 7 commits into from
Dec 11, 2021
Merged

Conversation

Friesoch
Copy link
Contributor

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

@Friesoch Friesoch requested a review from a team as a code owner November 14, 2021 08:00
@Friesoch
Copy link
Contributor Author

@fwolter here is the new Pull Request replacing the corrupted #9837

@wborn wborn added the new binding If someone has started to work on a binding. For a new binding PR. label Nov 14, 2021
bom/openhab-addons/pom.xml Outdated Show resolved Hide resolved
Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>
Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>
Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>
Copy link
Member

@fwolter fwolter left a 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.

localSocket.connect(new InetSocketAddress(host, port));
localSocket.setSoTimeout(SOCKET_TIMEOUT_SEC);
BufferedWriter localWriter = writer;
localWriter = new BufferedWriter(new OutputStreamWriter(localSocket.getOutputStream()));
Copy link
Member

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:

Suggested change
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().

Copy link
Contributor Author

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.

Copy link
Member

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 <frieso.aeschbacher@gmail.com>
Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>
Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>
bom/openhab-addons/pom.xml Outdated Show resolved Hide resolved
Signed-off-by: Fabian Wolter <github@fabian-wolter.de>
Copy link
Member

@fwolter fwolter left a 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

@fwolter fwolter merged commit 15b83cc into openhab:main Dec 11, 2021
@fwolter fwolter added this to the 3.2 milestone Dec 11, 2021
@Friesoch
Copy link
Contributor Author

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

NickWaterton pushed a commit to NickWaterton/openhab-addons that referenced this pull request Dec 30, 2021
* Added Dominoswiss to CODEOWNERS and POMs

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Intitial contribution of Dominoswiss Binding

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Typo in pom.xml

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed inputs from fwolter

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed inputs from fwolter

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed localWriter Issue

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Update bom/openhab-addons/pom.xml

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>

Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
mischmidt83 pushed a commit to mischmidt83/openhab-addons that referenced this pull request Jan 9, 2022
* Added Dominoswiss to CODEOWNERS and POMs

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Intitial contribution of Dominoswiss Binding

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Typo in pom.xml

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed inputs from fwolter

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed inputs from fwolter

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed localWriter Issue

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Update bom/openhab-addons/pom.xml

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>

Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
Signed-off-by: Michael Schmidt <mi.schmidt.83@gmail.com>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Jan 28, 2022
* Added Dominoswiss to CODEOWNERS and POMs

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Intitial contribution of Dominoswiss Binding

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Typo in pom.xml

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed inputs from fwolter

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed inputs from fwolter

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed localWriter Issue

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Update bom/openhab-addons/pom.xml

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>

Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this pull request May 5, 2022
* Added Dominoswiss to CODEOWNERS and POMs

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Intitial contribution of Dominoswiss Binding

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Typo in pom.xml

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed inputs from fwolter

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed inputs from fwolter

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed localWriter Issue

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Update bom/openhab-addons/pom.xml

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>

Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
* Added Dominoswiss to CODEOWNERS and POMs

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Intitial contribution of Dominoswiss Binding

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Typo in pom.xml

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed inputs from fwolter

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed inputs from fwolter

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed localWriter Issue

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Update bom/openhab-addons/pom.xml

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>

Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Nov 12, 2022
* Added Dominoswiss to CODEOWNERS and POMs

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Intitial contribution of Dominoswiss Binding

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Typo in pom.xml

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed inputs from fwolter

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed inputs from fwolter

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Fixed localWriter Issue

Signed-off-by: Frieso Aeschbacher <frieso.aeschbacher@gmail.com>

* Update bom/openhab-addons/pom.xml

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>

Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new binding If someone has started to work on a binding. For a new binding PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants