-
-
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
[mqtt.generic] Create the proper item type for channels with units #17929
[mqtt.generic] Create the proper item type for channels with units #17929
Conversation
Signed-off-by: Cody Cutrer <[email protected]>
This pull request has been mentioned on openHAB Community. There might be relevant details there: |
Build will fail until openhab/openhab-core#4507 is merged. |
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, thank you
Waiting for the merge of the required change in core framework. I assume the fix should be backported into 4.3 ? |
Yes. I think so. Both this PR in addons and the corresponding UnitUtils PR in core. |
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.
As discussed in OH core
if (unit == null) { | ||
return CoreItemFactory.NUMBER; | ||
} | ||
String dimension = UnitUtils.getDimensionName(unit); |
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.
You need to add your special Mirek case handler here. And only call getDimensionName() for other units.
String dimension = Units.MIRED == unit ? "Temperature" : UnitUtils.getDimensionName(unit);
Signed-off-by: Cody Cutrer <[email protected]>
This is no longer dependent on the core PR |
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
…17929) * [mqtt.generic] create the proper item type for channels with units Signed-off-by: Cody Cutrer <[email protected]>
Nack-ported to 4.3.x branch. |
@ccutrer congrats :) sorry that it was like squeezing water out of a stone :( |
Fixes https://community.openhab.org/t/openhab-4-3-zigbee2mqtt-color-temperature-in-mired-not-working/160911/8