tobof / openhab-addons

The next-generation open Home Automation Bus (openHAB)
Eclipse Public License 2.0
39 stars 30 forks source link

Binding issue related to recent updates on Smarthome API #40

Closed andreacioni closed 7 years ago

andreacioni commented 7 years ago

Hi Tim!

Due to the recent issue on the binding please note that conversation about new API lifecycle https://github.com/eclipse/smarthome/pull/2087.

I think that one try you could do is to put event listener registration inside MySensorsThingHandler.initialize(). This should allow you to avoid the problem. I've tested this on my refactoring (I hope to PR it early 😉 ) but should work also in your version.

Let me know!

andreacioni commented 7 years ago

Take a look here

tobof commented 7 years ago

Hey Andrea!

Thank you for your input, I've come to the same conclusion. One additional change is, that the ThingStatus has set to ONLINE on init, because otherwise the thing will update although it is OFFLINE. ;-)

It also fixes the problem with autodiscovery, which is reasonable, because they never come ONLINE and register the EventListener till the bridge changes its status.

I'll do some further testing and push the changes.

tobof commented 7 years ago

Problem is solved.

Bindings from now on are not backward compatible due to the changes in the OH2 API.