[Solved] OH2: bindingChanged/allBindingsChanged not called after items loading

During the starting process (OH 2 beta 2), my 1.x binding is started before items are loaded. Why not.
I was expecting that after items are loaded, either method bindingChanged or allBindingsChanged would have been called.
At least that is the behaviour in OH 1.

@Kai: is there a bug with that in the compatibility layer ?

One time again, it was OK using the before beta versions of OH2. Something has changed ?

I cannot find a bug and it seems to work as expected.

I just remote debugged on a 2.0beta2 (Karaf) instance (using the HTTP binding):
Indeed, the binding starts before the items are read and thus the allBindingsChanged method is called at a time when no items are there yet. So this is probably different to before, but as you say, fully ok.
Once the items are read, the BindingConfigReaders are called and they are supposed to a addBindingConfig on the BindingProvider, which then calls the bindingChanged method. If the binding uses the AbstractGenericBindingProvider as a base implementation, this should all work fine.

Maybe that is a consequence to the fact that immediate=true was not set in my binding.
I will do a new test later today and let you know if the problem is fixed.
But thank you for your answer and the test you did.

Confirmed. That is now working well. Sorry for your time spent on this.

1 Like