-
-
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
[amazonechocontrol] Improve color temperature channel #17754
Conversation
Signed-off-by: AndrewFG <[email protected]>
Signed-off-by: AndrewFG <[email protected]>
Signed-off-by: AndrewFG <[email protected]>
Signed-off-by: AndrewFG <[email protected]>
Signed-off-by: AndrewFG <[email protected]>
Signed-off-by: AndrewFG <[email protected]>
|
I'd be happy to approve if I knew what the consequences of the hint are and where it could hurt or not and how I can test it. Any hint (no pun intended ;-) )? |
A unitHint on a channel means when you go to that channel in MainUI and link it to a new item, that item will default to the channel's unitHint for its unit. |
This PR relates particulary to colour temperature channels on lights, which should have items that display in Kelvin or Mirek (micro inverse Kelvin). The problem is that currently OH creates such items by default using the local system temperature unit Celsius or Fahrenheit; neither of which is appropriate to colour temperatures.. |
@lolodomo I am not sure if tapocontrol and tplink require update instructions.. |
Signed-off-by: AndrewFG <[email protected]>
Signed-off-by: AndrewFG <[email protected]>
@lolodomo I have split all the bindings into separate PRs. This PR is now repurposed for AmazonEchoControl only. |
Please consider my review comments in the new PRs. |
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, LGTM
When I create a managed thing (astro as an example), here is a portion of this thing in file org.openhab.core.thing.Thing.json:
So you can see that each channel has a field "itemType". |
The documentation of the thing upgrade tool is really hidden in our documentation. I am not able to find it from the menu or from a search. |
A Google search helped me. From the XSD, it looks like it is not possible to provide a new item type. |
Indeed! That is why I was confused when you requested me to put that in the upgrade instructions. I think there are two possible conclusions, either:
I don't know if it is 1. or 2. above. But if it is 1. then I think my PRs are OK. Whereas if it is 2. then someone needs to open an issue and respective PR in OH Core; and we should mark my PRs as "pending other PR". Or ?? |
We need someone to test if item type is automatically updated when using "update-channel" instruction. If not, try remove-channel + add-channel as a workaround. I am already almost sure it will work with such combination. |
AFAICT the code is here (below) .. whereby the |
If @J-N-K could confirm or if someone could test it, that would be great and we could simply merge all the PRs. |
I just tested this. My conclusion is that the itemType is updated with upgrade instructions just by updating the This instruction:
Is enough to change:
To:
@lolodomo if you are confident enough with these tests that the itemType is actually updated, i'll merge the color temperature PR's. |
I concur. That is what the OH core shows it is doing. The previous channel is totally destroyed, and a new channel is created from the channel-type; it does not care about the contents of the prior channel-type.. |
@lsiepel : thank you a lot for testing that. |
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
Signed-off-by: AndrewFG <[email protected]>
Signed-off-by: AndrewFG <[email protected]>
Refers to #17638 (comment)
Signed-off-by: AndrewFG [email protected]