-
-
Notifications
You must be signed in to change notification settings - Fork 428
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
ProfileTypeBuilder.withSupportedChannelTypeUIDs is ignored by StateProfileTypeImpl #4293
Labels
bug
An unexpected problem or unintended behavior of the Core
Comments
I see your use-case. I think there never was a discussion about filtering |
Can you prepare a pull request? |
This issue has been mentioned on openHAB Community. There might be relevant details there: |
obones
added a commit
to obones/openhab-core
that referenced
this issue
Jul 22, 2024
…o the ProfileType interface so that StateProfileType and TriggerProfileType can both take the three filter lists given by ProfileTypeBuilder Fixes openhab#4293
obones
added a commit
to obones/openhab-core
that referenced
this issue
Jul 22, 2024
…o the ProfileType interface so that StateProfileType and TriggerProfileType can both take the three filter lists given by ProfileTypeBuilder Fixes openhab#4293 Signed-off-by: Olivier Sannier <[email protected]> (github: obones)
obones
added a commit
to obones/openhab-core
that referenced
this issue
Jul 22, 2024
…o the ProfileType interface so that StateProfileType and TriggerProfileType can both take the three filter lists given by ProfileTypeBuilder Fixes openhab#4293 Signed-off-by: Olivier Sannier <[email protected]> (github: obones) Signed-off-by: OBones <[email protected]>
I have submitted PR #4325, I hope it's fine as I could not find any related unit tests. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When writing an addon that provides a transformation profile one will most likely use
ProfileTypeBuilder
to get an instance ofProfileType
to be returned by theProfileTypeProvider.getProfileTypes
implementation.This is can be done with code like this:
With the code above, the transformation profile is usable for any item and any channel, which may not be desirable and so one may want to call
withSupportedChannelTypeUIDs
to limit the transformation profile to a given channel type.Expected Behavior
When
withSupportedChannelTypeUIDs
has been called onProfileTypeBuilder
, the created transformation profile should only appear on item links that are between any item and a channel only of the given type UID.Current Behavior
Sadly, the profile above is shown for links on any channel, there are no filtering done.
This is because
ProfileTypeBuilder.newState
sets up a callback that ignoresleSupportedChannelTypeUIDs
at this linePossible Solution
I would suggest changing
StateProfileTypeImpl
to acceptsupportedChannelTypeUIDs
in its constructor and overridegetSupportedChannelTypeUIDs
just likeTriggerProfileTypeImpl
does.Note that this would only fix the current issue, but I believe both
StateProfileTypeImpl
andTriggerProfileTypeImpl
should override the three possible filtering sources, not two each like now.Steps to Reproduce (for Bugs)
ProfileTypeProvider
serviceProfileTypeBuilder.newState
alongsidewithSupportedChannelTypeUIDs
Context
I'm currently trying to offer transformation profiles for Air Quality Indicator channels in my OpenMeteo binding and would like them to be limited to channels they apply to.
Your Environment
The text was updated successfully, but these errors were encountered: