-
-
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
[boschspexor] Initial contribution #12706
Conversation
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/bosch-spexor-binding-openhab3-beta/135090/1 |
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.
Thank you for contributing!
I mainly focused on housekeeping and checked allmost all files. I think other reviewers would need to check licences, oauth/servlet and thingstate handling etc If i have more time i try to do another pass.
...or/src/main/java/org/openhab/binding/boschspexor/internal/BoschSpexorThingConfiguration.java
Outdated
Show resolved
Hide resolved
...chspexor/src/main/java/org/openhab/binding/boschspexor/internal/BoschSpexorThingHandler.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.boschspexor/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.boschspexor/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.boschspexor/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
...les/org.openhab.binding.boschspexor/src/main/resources/OH-INF/i18n/boschspexor_xx.properties
Outdated
Show resolved
Hide resolved
...ain/java/org/openhab/binding/boschspexor/internal/discovery/BoschSpexorDiscoveryService.java
Outdated
Show resolved
Hide resolved
Latest changes on code due to the recommendation of @lsiepel applied |
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.
Some small feedback. It's allways good to use a spell checker on documentation before a commit :-)
Please also mark feeedback that is resolved.
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.
added some comment to request more details
...chspexor/src/main/java/org/openhab/binding/boschspexor/internal/BoschSpexorThingHandler.java
Outdated
Show resolved
Hide resolved
...xor/src/main/java/org/openhab/binding/boschspexor/internal/api/service/SpexorAPIService.java
Show resolved
Hide resolved
7fa8f5b
to
555ec9d
Compare
Something went wrong, the pr now seems to include changes for other bindings? |
@Hilbrand will try to fix it. Didn't added this - only due to the CDO recommendation... |
…ents Signed-off-by: Marc Fischer <marc.fischer2@bosch.io>
6be0d20
to
c91a5b2
Compare
sorry for having some unwished commits in the PR. Big sorry but I saved everything and applied your PR recommendations. Only topic currently is the point by @lsiepel regarding the topic of returning an empty list and and maybe confuse the user. But in this case I tested a lot and adjusted the behavior and it was working as expected. Including behavior of detaching things that are not any more available. |
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.
Here is a first review. I haven't reviewed everything, but wanted to give this. One part not completely reviewed is regarding the channels dynamically added. The sensors channels could also be of a QuantityType
and given them units, but this will be more work, as each unit type you need to define a separate channels.
Regarding OAuth2. openHAB has built in support for OAuth2 authentication flow. Did that not work? or did it miss anything?
bundles/org.openhab.binding.boschspexor/LICENCES_USED_LIBRARIES
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.boschspexor/src/main/feature/feature.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.boschspexor/src/main/resources/html/resources/QRCODE_LICENSE_MIT
Show resolved
Hide resolved
bundles/org.openhab.binding.boschspexor/src/main/resources/OH-INF/config/configs.xml
Outdated
Show resolved
Hide resolved
.../main/java/org/openhab/binding/boschspexor/internal/api/service/BoschSpexorBridgeConfig.java
Outdated
Show resolved
Hide resolved
...chspexor/src/main/java/org/openhab/binding/boschspexor/internal/BoschSpexorThingHandler.java
Outdated
Show resolved
Hide resolved
...chspexor/src/main/java/org/openhab/binding/boschspexor/internal/BoschSpexorThingHandler.java
Outdated
Show resolved
Hide resolved
...chspexor/src/main/java/org/openhab/binding/boschspexor/internal/BoschSpexorThingHandler.java
Outdated
Show resolved
Hide resolved
...chspexor/src/main/java/org/openhab/binding/boschspexor/internal/BoschSpexorThingHandler.java
Outdated
Show resolved
Hide resolved
...chspexor/src/main/java/org/openhab/binding/boschspexor/internal/BoschSpexorThingHandler.java
Show resolved
Hide resolved
Hello @Hilbrand, thanks for your review. I also requested a bit of support here: openHAB Community: OAuth2.0 Device Authorization Grant (device_code) but also there was the same outcome to use custom implementation. |
Signed-off-by: Marc Fischer <marc.fischer2@bosch.io>
Signed-off-by: Marc Fischer <marc.fischer2@bosch.io>
...c/main/java/org/openhab/binding/boschspexor/internal/api/service/auth/SpexorAuthServlet.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/openhab/binding/boschspexor/internal/api/service/SpexorBridgeHandler.java
Outdated
Show resolved
Hide resolved
...chspexor/src/main/java/org/openhab/binding/boschspexor/internal/BoschSpexorThingHandler.java
Outdated
Show resolved
Hide resolved
…s to a better fitting one Signed-off-by: Marc Fischer <marc.fischer2@bosch.io>
…ndation for better UX' Signed-off-by: Marc Fischer <marc.fischer2@bosch.io>
...hspexor/src/main/java/org/openhab/binding/boschspexor/internal/BoschSpexorBridgeHandler.java
Outdated
Show resolved
Hide resolved
...hspexor/src/main/java/org/openhab/binding/boschspexor/internal/BoschSpexorBridgeHandler.java
Outdated
Show resolved
Hide resolved
...hspexor/src/main/java/org/openhab/binding/boschspexor/internal/BoschSpexorBridgeHandler.java
Show resolved
Hide resolved
...hspexor/src/main/java/org/openhab/binding/boschspexor/internal/BoschSpexorBridgeHandler.java
Outdated
Show resolved
Hide resolved
...hspexor/src/main/java/org/openhab/binding/boschspexor/internal/BoschSpexorBridgeHandler.java
Outdated
Show resolved
Hide resolved
...va/org/openhab/binding/boschspexor/internal/api/service/auth/SpexorAuthorizationService.java
Outdated
Show resolved
Hide resolved
...chspexor/src/main/java/org/openhab/binding/boschspexor/internal/BoschSpexorThingHandler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Marc Fischer <marc.fischer2@bosch.io>
Signed-off-by: Marc Fischer <marc.fischer2@bosch.io>
Signed-off-by: Marc Fischer <marc.fischer2@bosch.io>
Signed-off-by: Marc Fischer <marc.fischer2@bosch.io>
Signed-off-by: Marc Fischer <marc.fischer2@bosch.io>
There were already several review steps. What is the current status ? @Hilbrand : is your review finished ? |
@@ -0,0 +1,72 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" | |||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
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.
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
See #11833
<parent> | ||
<groupId>org.openhab.addons.bundles</groupId> | ||
<artifactId>org.openhab.addons.reactor.bundles</artifactId> | ||
<version>3.4.0-SNAPSHOT</version> |
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.
<version>3.4.0-SNAPSHOT</version> | |
<version>4.2.0-SNAPSHOT</version> |
@@ -0,0 +1,11 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
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.
This needs to be adapted to the new addon.xml, the PR to adapt the developer docs is not merged yet, so if you need more details, the corresponding issue is here: openhab/openhab-core#2058
But you can also update your branch and look at another binding's addon.xml and adapt it to this initial contribution.
Unfortunately it looks like we cannot bring this PR to the finish line. After two years of inactivity i close this PR. If there is a need to restart, feel free to re-open or start a new PR. |
Hello guys,
Description
this is the initial contribution to support the Bosch spexor with openHAB 3.2.x.
The binding requires a short simple configuration and provides a servlet which guides any user to setup the plugin.
I already provided an community post with a bit of information about the Bosch spexor here: https://community.openhab.org/t/bosch-spexor-binding-openhab3-beta/135090
The goal of the new Binding is that we would like to enable a) openHAB with a smart sensor that measures Air Quality - Acceleration, Temperature etc. and also b) enable the spexor to other systems easily to get a better user experience.
We do think that also the openHAB could also be used on mobile devices like camper to also get thus smart.
Used libraries
The addon is having a servlet for easy setup and is storing and handling an OAuth 2.0 device code flow mechanism.
Therefore I included some apache 2.0 licensed libraries for better and stable inclusion.
I did some bounding to the internal http client of openHAB to consider system setups of openHAB. It also contains embedded jquery and a QRcode library in javascript based on MIT licenses. I added them also into the source code for traceability.
For more details please see the attached commit information file LICENSES_USED_LIBRARIES
Testing
The code was originally developed based on the 3.1.x version and is now linked to 3.2.x version.
The code is tested with 3.1.x as well as 3.2.x version on Mac - Linux and Windows based openHAB installations.
I created a few unit tests / integration tests to reflect server communication and also the mechanism of the authorization flow to ensure that everything is working proper. The tests are do need a while due to a simulated state.
Code
I checked all coding guidelines and applied them as I understood. Findings are only on Unit tests but the marked issues are wished and should consider error cases. The code is also shared through my department and I'm contributing this we rules of Bosch.IO. Therefore we did also lots of checks regarding security & open source compliance.
Please let me know if I need to change something. My team and me are using this quite a long time and didn't had any bad experience but if so, let me know!!
Marc