-
-
Notifications
You must be signed in to change notification settings - Fork 415
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
[REST] Add thing status to ThingAddedEvent
#3112
Comments
But how will this solve the linked issue? It seems that the events are in the wrong order, which results in the ThingStatusInfoEvent being emitted before the ThingAddedEvent. In this case overwriting the ThingStatusEvent with a status from the ThingAddedEvent could result in a wrong state. When the thing is created, the status is always UNINITIALIZED, so that would be the status present in the ThingAddedEvent. I don't see any benefit in adding that to the event. All status changes are then reported with ThingStatusEvent/ThingStatusInfoChangedEvent. |
Currently I receive the If the status information would be part of the
You know this because you are an absolute openHAB expert. It is not in the official docs and there is no lifecycle diagram where I can easily find this information.
For somebody who doesn't know the internals it might be an important information. These are ~20bytes with neglectable overhead but they transfer required knowledge from the API consumer to the openHAB core. It's important to realize that not all API consumers are openHAB experts. |
@J-N-K Could you find it in your heart to implement this or point me in the right direction where this can be changed? I searched the source code this morning but I am really having a hard time understanding it. The warnings are quite annoying and I think it's good to make the events more explicit (from an API perspective). |
The event is created via So to get the thing status into the event one would need to create an enriched You would also need to take care of the "inverse" method ( I still think that status and entity events should in general not be mixed. Also the next question will probably be, why the |
I agree that it's not optimal. But when I create the thing on the client side I need to use a value for the status and for the status detail. You mentioned that on creation the thing status is always |
The thing status detail gets initialized as "NONE" |
In case of a disabled item it is then immediately updated to UNINITIALIZED/DISABLED. |
But that will be properly reported by a ThingStatusUpdate, correct? |
2x yes: there is an update event and NONE is always the first status. |
I must have been blind, the docs are excellent! |
As described by @J-N-K in #3070: the thing has always a status.
This status should be part of the
ThingAddedEvent
as it is the only information missing to create a full thing object on the HABApp side.The text was updated successfully, but these errors were encountered: