-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
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. |
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.
Looks good so far, I just had a look at your code and did not test it from a user perspective yet.
...hshc/src/main/java/org/openhab/binding/boschshc/internal/devices/bridge/BoschHttpClient.java
Show resolved
Hide resolved
@Nullable | ||
BoschHttpClient httpClient = this.httpClient; | ||
if (httpClient == null) { | ||
return false; | ||
return null; |
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.
In my opinion we should start to throw something like a NotInitializedException in cases like this. What do you think?
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.
- throw exception instead return null - will also avoid @nullable
@Nullable | ||
ArrayList<Device> devices = null; | ||
devices = shcBridgeHandler.getDevices(); | ||
for (Device device : devices) { |
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.
Don't forget the null check :)
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]>
Signed-off-by: Gerd Zanker <[email protected]>
23f3a35
to
aa4fefd
Compare
This pull request is replaced with a new openhab pull request now merged directly to main branch. |
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.