-
-
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
[knx] Refactoring of KnxCoreTypeMapper and UOM Support #14534
Conversation
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.
I didn't check in detail if everything is ok, just a comment while scrolling though the code. But I did not see anything obviously wrong.
...penhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/dpt/KNXCoreTypeMapper.java
Outdated
Show resolved
Hide resolved
043996c
to
1510d6f
Compare
See also comment about |
Thanks, @jlaur. It looks like |
I didn't analyze it further since I was busy with something else at the time, so just took note. Maybe it would be worth adding the missing format to the core |
They don‘t provide the same results, otherwise I wouldn’t have implemented it in another way :-) I would suggest to adjust core to the implementation on SmartHome/J (including the tests). |
Regarding color: see openhab/openhab-core#3434 |
Preparation for refactoring KnxCoreTypeMapper. Carryover from smarthomej/addons#107. Merge UOM implementations. Also-by: Jan N. Klug <[email protected]> Signed-off-by: Holger Friedrich <[email protected]>
DPT strings for QuantityType now strip off a tailing .0 when decimals are converted. Signed-off-by: Holger Friedrich <[email protected]>
Use pattern matching with instanceof operator (new Java17 feature). Signed-off-by: Holger Friedrich <[email protected]>
7039704
to
208f122
Compare
@J-N-K this PR has become quite huge, as it includes the complete restructuring of I have kept the work split into several commits to match the changes in smarthome/j and added additional commits to fix the unit tests for UoM we had added in this repo only. One open point is HSB color transform with (x,y,Y) - this is currently failing until we have ColorUtil in the core. I did not have time yet to check it with my KNX installation. |
Introduce KNXChannel class. Carryover from smarthomej/addons#114. Also-by: Jan N. Klug <[email protected]> Signed-off-by: Holger Friedrich <[email protected]>
Configuring incompatible DPT/channel combinations (e.g. DPT 1.005 (alarm) on Contact channels or DPT 1.019 (windows/door) on Switch channels) is not allowed but was silently ignored. This PR adds a warning in case incompatible configurations are detected. Carryover from smarthomej/addons#203. Also-by: Jan N. Klug <[email protected]> Signed-off-by: Holger Friedrich <[email protected]>
Replace UoM handling with the implementation from smarthome/j. Carryover from smarthomej/addons#206. Also-by: Jan N. Klug <[email protected]> Signed-off-by: Holger Friedrich <[email protected]>
Carryover from smarthomej/addons#208. Also-by: Jan N. Klug <[email protected]> Signed-off-by: Holger Friedrich <[email protected]>
Carryover from smarthomej/addons#219. Also-by: Jan N. Klug <[email protected]> Signed-off-by: Holger Friedrich <[email protected]>
Carryover from smarthomej/addons#226. Also-by: Jan N. Klug <[email protected]> Signed-off-by: Holger Friedrich <[email protected]>
Carryover from smarthomej/addons#230. Also-by: Jan N. Klug <[email protected]> Signed-off-by: Holger Friedrich <[email protected]>
Carryover from smarthomej/addons#279. Also-by: Jan N. Klug <[email protected]> Signed-off-by: Holger Friedrich <[email protected]>
Carryover from smarthomej/addons#349. Also-by: Jan N. Klug <[email protected]> Signed-off-by: Holger Friedrich <[email protected]>
Signed-off-by: Holger Friedrich <[email protected]>
PR openhab#12995 was lost during merge and is now re-added. Signed-off-by: Holger Friedrich <[email protected]>
Signed-off-by: Holger Friedrich <[email protected]>
@holgerfriedrich - LGTM except for #14534 (comment). FYI, @kaikreuzer has reviewed and merged openhab/openhab-core#3434 less than an hour ago, so can be completed now. 🙂 |
Note that this requires openHAB core >4.0.0.M1. Signed-off-by: Holger Friedrich <[email protected]>
@jlaur I just pushed then new version which uses ColorUtil. I think it will only build after the next core snapshot is built tomorrow morning. |
Signed-off-by: Holger Friedrich <[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.
LGTM
Ok, then let's wait for tomorrow. I will rebuild. Regarding the squash merge of this PR, please take care of the references to the original PRs, please keep @J-N-K in the joint sign-off. |
Reference openhab/openhab-addons#14534. Signed-off-by: Holger Friedrich <[email protected]>
@holgerfriedrich & @J-N-K One thing that I noted was that I had a few DPTs wrongly set in my I am not sure whether that‘s a core or a KNX binding problem, but when I change my yamaha.things file, the Yamaha devices go OFFLINE and then ONLINE, my KNX devices don‘t (and they did in the past). |
Interesting that this error is back, I'm pretty sure I fixed that one. I'll have a look but I have some other things I'm working on before. |
* [knx] Refactoring, add basic support for UOM Preparation for refactoring KnxCoreTypeMapper. Carryover from smarthomej/addons#107. Merge UOM implementations. * [knx] Adapt tests DPT strings for QuantityType now strip off a tailing .0 when decimals are converted. * [knx] Refactoring Use pattern matching with instanceof operator (new Java17 feature). * [knx] Refactoring, performance improvements Introduce KNXChannel class. Carryover from smarthomej/addons#114. * [knx] Add warning for incompatible DPT type Configuring incompatible DPT/channel combinations (e.g. DPT 1.005 (alarm) on Contact channels or DPT 1.019 (windows/door) on Switch channels) is not allowed but was silently ignored. This PR adds a warning in case incompatible configurations are detected. Carryover from smarthomej/addons#203. * [knx] Add full support for UoM Replace UoM handling with the implementation from smarthome/j. Carryover from smarthomej/addons#206. * [knx] Refactor KNXCoreTypeMapper, add RGBW and xyY Carryover from smarthomej/addons#208. * [knx] Fix RGB conversion Carryover from smarthomej/addons#219. * [knx] Remove workarounds obsoleted by Calimero 2.5 Carryover from smarthomej/addons#226. * [knx] Add parameter for disabling incoming UoM Carryover from smarthomej/addons#230. * [knx] Fix fallback to DecimalType in number conversion Carryover from smarthomej/addons#279. * [knx] Fix DPT 251.600 decoding Carryover from smarthomej/addons#349. * [knx] Fix UoM handling for special types * [knx] Add test for KNXChannelFactory * [knx] Update CODEOWNERS for knx * [knx] Default conversion for DPT 5.001 and 6.001 * [knx] Fix write blocked forever after read from bus Carryover from smarthomej/addons#299 and smarthomej/addons#330. * [knx] Use new class ColorUtil from core for HSB conversion Also-by: Jan N. Klug <[email protected]> Signed-off-by: Holger Friedrich <[email protected]>
Reference openhab/openhab-addons#14534. Signed-off-by: Holger Friedrich <[email protected]>
Reference openhab/openhab-addons#14534. Signed-off-by: Holger Friedrich <[email protected]>
@J-N-K Any progress regarding this issue? |
Totally forgot about it. Do you still see it with latest snapshot? There was an issue with the file watcher some time ago that could have caused that problem, but it's fixed now. |
Unfortunately, this issue persists. The file change was noticed all the time and is still noticed ( I am not also encountering another weird behaviour: my |
I don't normally use things files. I tried and it works for me when I change the channel-name, but not the configuration or the channel label. Can you confirm that this is specific to the KNX binding? I'm asking because when I only change the label, the |
You are right, changing channel name works, but neither channel label nor configuration change work for KNX and MQTT, so it must be unspecific to the KNX binding. And it seems that you already found the cause. |
Stays just the other problem: My |
I have no idea what causes this behavior. But it’s a core issue, not an addons-issue. Please open a bug report there. |
* [knx] Refactoring, add basic support for UOM Preparation for refactoring KnxCoreTypeMapper. Carryover from smarthomej/addons#107. Merge UOM implementations. * [knx] Adapt tests DPT strings for QuantityType now strip off a tailing .0 when decimals are converted. * [knx] Refactoring Use pattern matching with instanceof operator (new Java17 feature). * [knx] Refactoring, performance improvements Introduce KNXChannel class. Carryover from smarthomej/addons#114. * [knx] Add warning for incompatible DPT type Configuring incompatible DPT/channel combinations (e.g. DPT 1.005 (alarm) on Contact channels or DPT 1.019 (windows/door) on Switch channels) is not allowed but was silently ignored. This PR adds a warning in case incompatible configurations are detected. Carryover from smarthomej/addons#203. * [knx] Add full support for UoM Replace UoM handling with the implementation from smarthome/j. Carryover from smarthomej/addons#206. * [knx] Refactor KNXCoreTypeMapper, add RGBW and xyY Carryover from smarthomej/addons#208. * [knx] Fix RGB conversion Carryover from smarthomej/addons#219. * [knx] Remove workarounds obsoleted by Calimero 2.5 Carryover from smarthomej/addons#226. * [knx] Add parameter for disabling incoming UoM Carryover from smarthomej/addons#230. * [knx] Fix fallback to DecimalType in number conversion Carryover from smarthomej/addons#279. * [knx] Fix DPT 251.600 decoding Carryover from smarthomej/addons#349. * [knx] Fix UoM handling for special types * [knx] Add test for KNXChannelFactory * [knx] Update CODEOWNERS for knx * [knx] Default conversion for DPT 5.001 and 6.001 * [knx] Fix write blocked forever after read from bus Carryover from smarthomej/addons#299 and smarthomej/addons#330. * [knx] Use new class ColorUtil from core for HSB conversion Also-by: Jan N. Klug <[email protected]> Signed-off-by: Holger Friedrich <[email protected]>
This is a merge of smarthome/j code to current code base.
It will include several PRs from smarthome/j related to UOM and refactoring of KnxCoreTypeMapper.
Carryover from
smarthomej/addons#107
smarthomej/addons#114
smarthomej/addons#203
smarthomej/addons#206
smarthomej/addons#208
smarthomej/addons#219
smarthomej/addons#226
smarthomej/addons#230
smarthomej/addons#279
smarthomej/addons#299
smarthomej/addons#330
smarthomej/addons#349
Also-by: Jan N. Klug [email protected]
Refs: #14502