-
-
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
[tacmi] Support JSON-Api #14119
[tacmi] Support JSON-Api #14119
Conversation
f18651a
to
58053e3
Compare
@Wolfgang1966, @marvkis : Seems like I finally tricked the Null-Checker into working. The one running in the CI is even more broken then my local one ( 2022-03 ), which was happy with just reassigning to a local variable. I'm looking forward to a code review. |
Hi @cmorty , a great thank you for adding the JSON API! Just this morning I fell into a value scaling problem with the CoE interface after updating the firmware of my CMI (KW now are read ten times smaller than they really are, I correct this by a rule at the moment). Do you have a test version of your binding somewhere to download? I would really like to switch to JSON with my UVR1611 and hence would like to beta-test your binding. In parallel I start reviewing your PR. But as I would not consider myself a good Java programmer or too familiar with the coding standards of openHAB, so I would be glad if someone else with better knowledge in this topics would review it also. |
@Wolfgang1966 : The build-log says that it should be available under https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/addons/bundles/org.openhab.binding.tacmi/4.0.0-SNAPSHOT/org.openhab.binding.tacmi-4.0.0-SNAPSHOT.jar - I'm missing a PR-ID in that URL though. If it doesn't work: Ping me and I'll provide you with a You were automatically added as reviewer (not my choice). I'm a C++ developer. But the CI does quite a lot of checks, thus the most important issue probably is to make sure the code is sane. ;-) |
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.
Dear @cmorty, overall it looks good to me. I found only some small potential improvements.
Thanks again for your efforts
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/TACmiJsonHandler.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.tacmi/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.tacmi/src/main/resources/OH-INF/thing/thing-types.xml
Show resolved
Hide resolved
ed8f2c8
to
6322086
Compare
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. 👍
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.
Review part 1 of 2.
Remains doc, handler, Value and tests
.../org.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/Config.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.tacmi/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.tacmi/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.tacmi/src/main/resources/OH-INF/thing/thing-types.xml
Show resolved
Hide resolved
.../org.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/obj/IO.java
Outdated
Show resolved
Hide resolved
...g.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/obj/Value.java
Outdated
Show resolved
Hide resolved
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/obj/JsonResponse.java
Outdated
Show resolved
Hide resolved
...rg.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/obj/Data.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.tacmi/src/main/resources/OH-INF/thing/thing-types.xml
Show resolved
Hide resolved
Hi @cmorty , nice that your're integrating the JSON API into the binding! Having recently fought with my CMI to get all the values into openHAB with a lengthy Javascript rule myself, I was wondering: I haven't spotted anything in that direction during the (admittedly short) look I have given your code, hence my question... |
Yes it does. Even has a configuration option. As I updated OpenHab it looks like I actually want to look into this again. ;) |
749055a
to
f0093a2
Compare
This PR is against main (so yes it is towards 5.0.0) You might be able to build against another version as your feature branch is 100+ commits behind. No problem though. |
The last push also fixes some null-checks. Seems like Eclipse evaluates |
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.
Thanks for moving this forward! Looked at the remaining files, think this is the last review.
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/TACmiJsonHandler.java
Outdated
Show resolved
Hide resolved
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/TACmiJsonHandler.java
Outdated
Show resolved
Hide resolved
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/TACmiJsonHandler.java
Outdated
Show resolved
Hide resolved
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/TACmiJsonHandler.java
Show resolved
Hide resolved
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/TACmiJsonHandler.java
Outdated
Show resolved
Hide resolved
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/TACmiJsonHandler.java
Outdated
Show resolved
Hide resolved
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/TACmiJsonHandler.java
Outdated
Show resolved
Hide resolved
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/TACmiJsonHandler.java
Outdated
Show resolved
Hide resolved
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/TACmiJsonHandler.java
Outdated
Show resolved
Hide resolved
...g.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/obj/Value.java
Show resolved
Hide resolved
This implementation is based on the JSON-API provided by TA. Signed-off-by: Moritz 'Morty' Strübe <[email protected]>
Signed-off-by: Moritz 'Morty' Strübe <[email protected]>
Signed-off-by: Moritz 'Morty' Strübe <[email protected]>
Reorganize the documentation into main topics and separate Schema and CoE sections (instead of intermingling the to topics). No modifications but minor adjustments to the headings were made. Signed-off-by: Moritz 'Morty' Strübe <[email protected]>
Add documentation on how to use the JSON API. Signed-off-by: Moritz 'Morty' Strübe <[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.
Have some found left overs and two new comments. Otherwise LGTM.
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/TACmiJsonHandler.java
Outdated
Show resolved
Hide resolved
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/TACmiJsonHandler.java
Outdated
Show resolved
Hide resolved
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/TACmiJsonHandler.java
Outdated
Show resolved
Hide resolved
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/TACmiJsonHandler.java
Outdated
Show resolved
Hide resolved
@cmorty we are almost there, are you able to fix the last few comments? |
…nding/tacmi/internal/json/TACmiJsonHandler.java Signed-off-by: lsiepel <[email protected]>
…nding/tacmi/internal/json/TACmiJsonHandler.java Signed-off-by: lsiepel <[email protected]>
…nding/tacmi/internal/json/TACmiJsonHandler.java Signed-off-by: lsiepel <[email protected]>
…nding/tacmi/internal/json/TACmiJsonHandler.java Signed-off-by: lsiepel <[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.
Added 4 commits to resolve my last own comments. Removing logging etc.
@jlaur are you able to verify the last changes i made. I just don't want to merge my own changes, even though they are very small.
Edit: arg i ddidn;t expect these new license header issues. Let me fix that too.
The last four commits so far LGTM. |
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.
Fixing the headers (the fork is 2500 commits behind)
...rg.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/obj/Data.java
Outdated
Show resolved
Hide resolved
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/TACmiJsonHandler.java
Outdated
Show resolved
Hide resolved
.../org.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/Config.java
Outdated
Show resolved
Hide resolved
...g.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/obj/Value.java
Outdated
Show resolved
Hide resolved
...ab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/obj/JsonResponse.java
Outdated
Show resolved
Hide resolved
.../org.openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/obj/IO.java
Outdated
Show resolved
Hide resolved
....openhab.binding.tacmi/src/main/java/org/openhab/binding/tacmi/internal/json/obj/Header.java
Outdated
Show resolved
Hide resolved
...nhab.binding.tacmi/src/test/java/org/openhab/binding/tacmi/internal/json/obj/test/DeSer.java
Outdated
Show resolved
Hide resolved
…nding/tacmi/internal/json/obj/Data.java Signed-off-by: lsiepel <[email protected]>
…nding/tacmi/internal/json/Config.java Signed-off-by: lsiepel <[email protected]>
…nding/tacmi/internal/json/TACmiJsonHandler.java Signed-off-by: lsiepel <[email protected]>
…nding/tacmi/internal/json/obj/IO.java Signed-off-by: lsiepel <[email protected]>
…nding/tacmi/internal/json/obj/Value.java Signed-off-by: lsiepel <[email protected]>
…nding/tacmi/internal/json/obj/JsonResponse.java Signed-off-by: lsiepel <[email protected]>
…nding/tacmi/internal/json/obj/Header.java Signed-off-by: lsiepel <[email protected]>
…nding/tacmi/internal/json/obj/test/DeSer.java Signed-off-by: lsiepel <[email protected]>
This implementation is based on the JSON-API provided by TA.
The API is provided here: https://wiki.ta.co.at/C.M.I._JSON-API