Skip to content
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

[DSL] Expose ColorUtil methods to DSL rules #4410

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

holgerfriedrich
Copy link
Member

@holgerfriedrich holgerfriedrich commented Oct 7, 2024

  • Expose xyToKelvin and kelvinToXY
  • Add missing throws declaration
  • Expose xyToDuv

Unfortunately, we forgot about the throws declaration in #4367. This is API breaking, you might need to add a catch statement in binding code.

@holgerfriedrich holgerfriedrich requested a review from a team as a code owner October 7, 2024 16:27
@holgerfriedrich holgerfriedrich requested review from andrewfg and removed request for a team October 7, 2024 16:27
Copy link
Contributor

@andrewfg andrewfg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM many thanks.

@holgerfriedrich holgerfriedrich added the work in progress A PR that is not yet ready to be merged label Oct 7, 2024
@holgerfriedrich
Copy link
Member Author

Lets wait for #4401, then we can add xyToDuv as well.

* Expose xyToKelvin and kelvinToXY
* Add missing throws declaration

Signed-off-by: Holger Friedrich <[email protected]>
Signed-off-by: Holger Friedrich <[email protected]>
@holgerfriedrich holgerfriedrich added API breaking and removed work in progress A PR that is not yet ready to be merged labels Oct 7, 2024
@holgerfriedrich
Copy link
Member Author

Done.
I will create an additional PR in docs.
@florian-h05 do you want to create a change in JS scripting as well (follow-up to openhab/openhab-js#319)?

@florian-h05
Copy link
Contributor

These methods are just added to the CoreUtil class, correct?
In that case only a doc update in openhab-js is needed.

@andrewfg
Copy link
Contributor

andrewfg commented Oct 8, 2024

@holgerfriedrich apropos the thrown exception potentially breaking the API — two things..

  1. In [zigbee] Map colour temperature states to color HSB states org.openhab.binding.zigbee#855 I did not call the respective method, so that one will not be broken.
  2. Did you check the ColorUtil JUnit tests (here in core) since they do call the respective method?

florian-h05 added a commit to florian-h05/openhab-js that referenced this pull request Oct 8, 2024
florian-h05 added a commit to openhab/openhab-js that referenced this pull request Oct 8, 2024
@holgerfriedrich
Copy link
Member Author

@andrewfg thanks for checking, the build seems still fine. I think in tests it is not mandatory to catch all declared exceptions....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants