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

Bridge and Device discovery #92

Closed
wants to merge 2 commits into from
Closed

Bridge and Device discovery #92

wants to merge 2 commits into from

Conversation

GerdZanker
Copy link
Collaborator

Bridge and Device discovery for Bosch Smart Home

Bridge IP address is discovered via mDNS and query of public information
Device discovery requires a paired bride and must be started manually via "Scan" button.
Currently not all supported devices are discovered, but ShutterControl and TwinGuard shall work.

A lot of debugs and traces are in to simplify problem analysis.

Unit tests are pending, but needed to keep functionality stable for future.

@GerdZanker
Copy link
Collaborator Author

Hi @coeing, I need to resolve the TODOs regarding the httpClient, but feel free to take a look and discover your Smart Home.

@coeing
Copy link
Collaborator

coeing commented Feb 26, 2021

Hi @coeing, I need to resolve the TODOs regarding the httpClient, but feel free to take a look and discover your Smart Home.

@GerdZanker Yay, this is great and it makes the usage of our binding so much more comfortable :) I will check it out soon.

Copy link
Collaborator

@coeing coeing left a comment

Choose a reason for hiding this comment

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

Looks good so far, I just had a look at your code and did not test it from a user perspective yet.

@Nullable
BoschHttpClient httpClient = this.httpClient;
if (httpClient == null) {
return false;
return null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

In my opinion we should start to throw something like a NotInitializedException in cases like this. What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  • throw exception instead return null - will also avoid @nullable

@Nullable
ArrayList<Device> devices = null;
devices = shcBridgeHandler.getDevices();
for (Device device : devices) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't forget the null check :)

Base automatically changed from main to main.bac2 March 10, 2021 13:47
If a GET returns the public information,
then the returned shcIpAddress is reported as discovered bridge.

Signed-off-by: Gerd Zanker <[email protected]>

fixes and improvements for bridge discovery

Signed-off-by: Gerd Zanker <[email protected]>
@GerdZanker GerdZanker force-pushed the feature/Discovery branch from 23f3a35 to aa4fefd Compare May 2, 2021 16:43
@GerdZanker GerdZanker changed the base branch from main.bac2 to main May 2, 2021 16:43
@GerdZanker GerdZanker marked this pull request as ready for review May 2, 2021 16:46
@GerdZanker GerdZanker requested a review from stefan-kaestle as a code owner May 2, 2021 16:46
@GerdZanker
Copy link
Collaborator Author

This pull request is replaced with a new openhab pull request now merged directly to main branch.

@GerdZanker GerdZanker closed this Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants