Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » Limit to single instance of a Thing in binding
Limit to single instance of a Thing in binding [message #1744616] Wed, 28 September 2016 22:53 Go to next message
Jeff James is currently offline Jeff JamesFriend
Messages: 2
Registered: September 2016
Junior Member
Would like suggestions on where and how to implement this. I have a bridge (B) which can only have a single instance of a particular thing type (T). I was looking at overriding the createThing function to make sure B does not already have a T instantiated.

The createThing function gets passed a BridgeUID to the function, but how do I get the Bridge Thing in order to call getThings() to see if one is already instantiated?

Is there a better/alternative way to accomplish this?

Thanks,
Jeff
Re: Limit to single instance of a Thing in binding [message #1744800 is a reply to message #1744616] Fri, 30 September 2016 09:58 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
What exactly is it that you want to prevent/achieve?

You e.g. cannot prevent that users define any number of Things of the same type in a *.things file and associate them to your bridge. So you will have to deal with this in your handler implementations when they are initialized. Within the handler, you have access to the bridge handler, so you can report a configuration error and not put the Thing to ONLINE.

Regards,
Kai
Re: Limit to single instance of a Thing in binding [message #1744842 is a reply to message #1744800] Fri, 30 September 2016 17:05 Go to previous message
Jeff James is currently offline Jeff JamesFriend
Messages: 2
Registered: September 2016
Junior Member
Hi Kai - Thanks for the response.

I'm writing a binding to interface with Pentair pool equipment. There should only be a single controller on their control bus and since I'm not testing the binding in the case someone creates 2 controller things, the results are not predictable. So, I'd rather just prevent that configuration from being setup by someone.

Jeff
Previous Topic:Binding Transformation
Next Topic:Upnp Discovery issue
Goto Forum:
  


Current Time: Sat Nov 09 02:30:26 GMT 2024

Powered by FUDForum. Page generated in 0.03413 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top