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

[epsonprojector] Fix discovery service to prevent erroneous inbox items #12586

Merged
merged 3 commits into from
Apr 9, 2022

Conversation

mlobstein
Copy link
Contributor

Fix an issue with the Epson binding creating erroneous inbox items when AMX discovery beacon packets from other devices (GlobalCache, etc) are received. The code was improved to ignore non Epson discovery beacon packets and will handle multiple Epson projectors on the network properly (thread safe).

First discovered in this post: https://community.openhab.org/t/is-the-epson-projector-binding-abandoned/107769/82

Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
@mlobstein mlobstein added the bug An unexpected problem or unintended behavior of an add-on label Apr 7, 2022
@mlobstein mlobstein requested a review from mhilbush April 7, 2022 23:34
logger.trace("Multicast listener parsing announcement packet: {}", beacon);

clearProperties();
if (beacon.contains("EPSON") && beacon.contains("VideoProjector")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you purposely remove the toUpperCase calls? I thought those were there in case a future projector changed the case of those items (which admittedly seems unlikely).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was something that I had on the back burner for a while. There was a problem with another binding where similar code had issues on systems that were using a non-english language locale. It seems a little safer to match the actual value. I might revisit this.

Copy link
Contributor

@lolodomo lolodomo Apr 9, 2022

Choose a reason for hiding this comment

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

Is it ok now?
Why no more using toUpperCase for VideoProjector?

Copy link
Contributor Author

@mlobstein mlobstein Apr 9, 2022

Choose a reason for hiding this comment

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

It is not necessary. The string 'VideoProjector' is the given SDKClass name and will always be capital case as defined by the whitepaper I found on the AMX beacon spec. The few other examples that I found for a projector beacon supported this. Here is the whitepaper, the device class names are on the last page: https://trade.amx.com/assets/whitePapers/AMX.Dynamic.Device.Discovery.White.Paper.pdf

Copy link
Contributor

@mhilbush mhilbush left a comment

Choose a reason for hiding this comment

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

Other than my one question, this looks like a good solution.

Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
@lolodomo lolodomo merged commit 7613cbc into openhab:main Apr 9, 2022
@lolodomo lolodomo added this to the 3.3 milestone Apr 9, 2022
@mlobstein mlobstein deleted the epson_discoveryFix branch April 11, 2022 19:04
NickWaterton pushed a commit to NickWaterton/openhab-addons that referenced this pull request Apr 27, 2022
…ms (openhab#12586)

* Fix discovery service to prevent erroneous inbox items
* improve EPSON string matching

Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
…ms (openhab#12586)

* Fix discovery service to prevent erroneous inbox items
* improve EPSON string matching

Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Nov 12, 2022
…ms (openhab#12586)

* Fix discovery service to prevent erroneous inbox items
* improve EPSON string matching

Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Feb 23, 2023
…ms (openhab#12586)

* Fix discovery service to prevent erroneous inbox items
* improve EPSON string matching

Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants