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

[benqprojector] Migrate benqprojector binding to OH3 #10341

Merged
merged 13 commits into from
Jun 12, 2021

Conversation

mlobstein
Copy link
Contributor

This PR introduces a new BenQ projector binding for openHAB to replace the 1.x version. The code from this binding is a clone of the epsonprojector binding and incorporates all lessons learned there from migrating it to OH3.

This will replace the 1.x benqprojector binding referenced in #6179

@mlobstein mlobstein requested a review from a team as a code owner March 15, 2021 23:04
@wborn wborn added new binding If someone has started to work on a binding. For a new binding PR. oh1 migration Relates to migrating an openHAB 1 addon to openHAB 2 labels Mar 16, 2021
bundles/org.openhab.binding.benqprojector/README.md Outdated Show resolved Hide resolved
Comment on lines 158 to 170
while (elapsedTime < timeout) {
int availableBytes = in.available();
if (availableBytes > 0) {
byte[] tmpData = new byte[availableBytes];
int readBytes = in.read(tmpData, 0, availableBytes);
resp = resp.concat(new String(tmpData, 0, readBytes, StandardCharsets.US_ASCII));
if (resp.contains(END)) {
return resp.replaceAll("[\\r\\n*#>]", BLANK).replace(data, BLANK);
}
} else {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Why not move this code to the super class and reuse it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I moved these duplicate blocks to a common method.

Signed-off-by: Michael Lobstein <[email protected]>
Signed-off-by: Michael Lobstein <[email protected]>
Signed-off-by: Michael Lobstein <[email protected]>
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

@fwolter fwolter merged commit e452de8 into openhab:main Jun 12, 2021
@fwolter fwolter added this to the 3.1 milestone Jun 12, 2021
@mlobstein mlobstein deleted the benqprojector branch June 12, 2021 18:26
computergeek1507 pushed a commit to computergeek1507/openhab-addons that referenced this pull request Jul 13, 2021
lucacalcaterra pushed a commit to lucacalcaterra/openhab-addons that referenced this pull request Jul 26, 2021
lucacalcaterra pushed a commit to lucacalcaterra/openhab-addons that referenced this pull request Jul 26, 2021
lucacalcaterra pushed a commit to lucacalcaterra/openhab-addons that referenced this pull request Aug 3, 2021
frederictobiasc pushed a commit to frederictobiasc/openhab-addons that referenced this pull request Oct 26, 2021
thinkingstone pushed a commit to thinkingstone/openhab-addons that referenced this pull request Nov 7, 2021
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this pull request May 5, 2022
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. oh1 migration Relates to migrating an openHAB 1 addon to openHAB 2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants