-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Add an AbstractStorageBasedTypeProvider #3407
Conversation
You are pointing twice the same PR. Please fix one of them to point 14501. |
One note about naming - its not only a dynamic provider, its storage based. The dynamism part is far less specific than the way how it retains its sate. |
TR-064 is not affected, it dynamically creates the types, but does so when the binding starts up. Only bindings that create the thing/channel-type when the thing initializes are affected. But there is no need to rush, with #3397 in place it only causes a delay on startup but does not prevent the thing from initializing. |
Signed-off-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Jan N. Klug <github@klug.nrw>
cac5a9e
to
93c603c
Compare
Thanks for the workaround, and fixes! |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-4-0-snapshot-discussion/142322/293 |
Is this PR waiting for something? I'm not sure when I'll have time (my discretionary coding time is much less than it used to be), but I'd like to get started on using this for mqtt.homie and mqtt.homeassistant at some point. I suppose this PR doesn't have to be merged before I do that, it would just be a little bit easier. |
It's waiting for review. From the code it's complete. |
Happy to look, though I'm not a core maintainer. I looked through this PR, as well as the two linked reference implementations. |
I can see that the @openhab/core-maintainers : as several add-ons will require an update, please review & merge this PR not late (not just before the official release) to let each binding maintainer the time to adjust the bindings they maintained. |
It is at least handled in class |
Maybe I am wrong and for dynamic types, it is rather the responsibility of each binding to add/provide already localized types. |
If we look at channel labels and description for managed things: they are localized during creation and then the label/description is stored/restored from the database. The same thing applies here: The localization should take place during creation of the channel-type/thing-type and is then stored. |
I think you're right. So |
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, thanks.
...s/src/main/java/org/openhab/core/thing/binding/AbstractStorageBasedTypeProviderOSGiTest.java
Outdated
Show resolved
Hide resolved
…core/thing/binding/AbstractStorageBasedTypeProviderOSGiTest.java Signed-off-by: Kai Kreuzer <kai@openhab.org>
@J-N-K : as mentioned in openhab/openhab-addons@14954, I encounter deserialization errors when using this new class:
|
Do you think you can provide a PR for that? |
Unfortunately not, I should admit all this is a little obscure for me. |
* Add an AbstractDynamicTypeProvider Signed-off-by: Jan N. Klug <github@klug.nrw> GitOrigin-RevId: 8e1a2cf
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/incorporating-matter/127907/772 |
Related to #3394
This adds a combined type provider for use in bindings that create
ChannelType
s,ThingType
s orChannelGroupType
s dynamically. It provides methods for adding/removing these types and persists them, so they are available on next start-up. Together with #3397 this should allow a smooth transition for all bindings.There are two reference implementations for use in bindings: openhab/openhab-addons#14501 and openhab/openhab-addons#14507