-
Notifications
You must be signed in to change notification settings - Fork 780
Allow bindings to deactivate auto-update for channels #595
Comments
I am currently looking into this... Please correct me if I am wrong, but the auto-update post an update for the item after receiving a command for it. There could be different ways to implement that feature, so, without going into deeper details of the special implementations I assume the principle is equal. But what is the desired behaviour of:
At the moment, if there exists multiple |
Hm, I think the binding ID is much too coarse grained. The idea of this issue was to achieve a similar feature as in OH1, where a binding can decide for each item (here now channel), whether it wants to disable the auto-update as it itself will take care of reliable status updates after commands. This feature very much depends on the specific channel, so having just all on/off isn't imho helpful. Also note that the AutoUpdateBinding is a remainder of the otherwise already removed OH1 binding APIs - we will have to think about whether it makes sense to keep it in place (also with the AutoUpdateBindingConfigProvider interface). While this still allows the user to add an
To me, this is a bit unlogical (I cannot remember the reason why it had been built like that). Imho it would be better to give every binding a veto, so that auto-update if off, if a single binding turns it off as it wants to take care of the updates itself. |
It is at least helpful for persons like me, that don't rely an the auto-update at all and so I want to disable it for every item that is linked to some channel of a thing of that bindings.
Hm, if the binding author wants to use the auto-update for some channels and don't want to use it for others channel, why not simply put the updateState line into the handleCommand method of the respective channels.
I don't think it is very useful for the normal use case.
Okay for me, too, if we want to break the current behaviour. |
IIRC AutoUpdateBindingConfigProvider is not inly a reminder but used by model.item |
Well, there is a much simpler solution for you: Simply remove the autoupdate bundle from your setup :-)
Because the default behavior, especially if there is NO binding is that the state update is done. Removing this feature would force every binding to do it manually.
As we do not have a deactivation feature in place yet, but a large number of well-working bindings, I think this shows that deactivating the auto-update is rather the exception. And the required "bunch of configuration" could be a simple flag that we add to the channel xml, this can be pretty simply.
Yes, it is used for parsing the |
This does not work as long as I want to use an unmodified model.item. And as you have written above, there are bindings that rely on the auto-update, so, removing the auto-update bundle completely will not work, too. |
I updated the PR #3082
|
Ah, I wasn't even aware of the AutoUpdateGenericBindingConfigProvider. It does not seem to have any dependency to the model stuff, so possibly this could be moved to the autoupdate bundle (and thus allow you to not include it)? |
The class implements the BindingConfigReader interface that is part of model.item |
I just read though this discussion here. To be honest, I don't think this is going into the right direction. The problem I see is that the question whether the auto-update should be active or not not only depends on the binding developer's point of view, but also in many cases on the concrete setup and user preferences.
So, to be honest, I see that your approach fixing a flaw in the current auto-update binding. However, I would rather like to see it dropped completely and replaced by a core feature which is easier to handle configuration wise. |
@SJKA Thank you for your comment. To use your example:
If the profiles are handled separately the "no auto-update" profile will delegate the command to the handler. The "auto-update" profile will delegate the command to the other handler and update the item. This is okay for me (at least I think so at the moment) because if someone uses one item for two different channels the situation could be very indeterministic at all.
|
That is indeed a very valid point. My intention was the opposite: that as a user, I want to stay in control of who (framework, binding - and if so: which one...) updates the state of an item, in order to make such situations as deterministic as possible. So to stay in the above example: What if both bindings "veto" the auto-update and handle it themselves? Which one wins? And what if they don't behave in the exact same way? As a user, I want to be able to fix this. Nevertheless, I agree that my proposal for a default with the "logical OR" was not ideal. The "first veto disables the auto-update" might be the better default strategy. However, I still think that the user needs the ability to pick a "winner" binding. But maybe that's a different story about ignoring updates coming from a specific binding where the profile idea attached to ItemChannelLinks would be a better fit. And indeed, then it would be sufficient to have the auto-update configuration directly at the Item, and not at the ItemChannelLink. For the rest of my thoughts (i.e. influencing the communication between framework and binding wrt commands, updates, triggers in order to gain back some level control), I will of course create a separate issue once I have a valid proposal as a starting point. You convinced me that these two topics don't conflict with each other. But back to the topic of this issue: I actually tend to agree that it would make sense to break with the existing behavior wrt auto-update:
When touching all this anyway, I would even consider moving it into the core.thing bundle, dropping the extra autoupdate one. Even if there are solutions which only use bindings that handle the updates themselves and therefore don't need the auto-update feature, then exactly these bindings will have a dependency to the autoupdate bundle because they want to declare their "opt-in". So I don't see any value in having it separated, or did I miss anything? |
PS: Just to make this clear
I'm very well aware that as of today we don't have configurations on item level. And probably also don't want that. So we could use ItemChannelLink properties for this, but should be aware that conceptually this would be what it is: First "opt-in" of a binding wins for the whole item and an explicit enabling of auto-update at any ItemChannelLink would overrule any binding's opt-ins and still enable the auto-update. |
ping! |
@digitaldan Currently there is a PR #4108 which introduces profiles on |
migrated from Bugzilla #481178
status NEW severity normal in component Core for ---
Reported in version unspecified on platform PC
Assigned to: Project Inbox
On 2015-10-31 19:43:07 -0400, Kai Kreuzer wrote:
The text was updated successfully, but these errors were encountered: