-
-
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
[benqprojector] Migrate benqprojector binding to OH3 #10341
Conversation
Signed-off-by: Michael Lobstein <[email protected]>
Signed-off-by: Michael Lobstein <[email protected]>
Signed-off-by: Michael Lobstein <[email protected]>
Signed-off-by: Michael Lobstein <[email protected]>
Signed-off-by: Michael Lobstein <[email protected]>
Signed-off-by: Michael Lobstein <[email protected]>
Signed-off-by: Michael Lobstein <[email protected]>
...or/src/main/java/org/openhab/binding/benqprojector/internal/BenqProjectorHandlerFactory.java
Outdated
Show resolved
Hide resolved
.../java/org/openhab/binding/benqprojector/internal/connector/BenqProjectorSerialConnector.java
Outdated
Show resolved
Hide resolved
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) { |
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.
Same here. Why not move this code to the super class and reuse it?
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.
Agreed, I moved these duplicate blocks to a common method.
bundles/org.openhab.binding.benqprojector/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.benqprojector/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
Signed-off-by: Michael Lobstein <[email protected]>
Signed-off-by: Michael Lobstein <[email protected]>
Signed-off-by: Michael Lobstein <[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
Signed-off-by: Michael Lobstein <[email protected]>
Signed-off-by: Michael Lobstein <[email protected]> Signed-off-by: Luca Calcaterra <[email protected]>
Signed-off-by: Michael Lobstein <[email protected]> Signed-off-by: Luca Calcaterra <[email protected]>
Signed-off-by: Michael Lobstein <[email protected]> Signed-off-by: Luca Calcaterra <[email protected]>
Signed-off-by: Michael Lobstein <[email protected]>
Signed-off-by: Michael Lobstein <[email protected]>
Signed-off-by: Michael Lobstein <[email protected]>
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