Event driven binding - Implementation pattern advice [message #1769909] |
Sat, 05 August 2017 05:29  |
Eclipse User |
|
|
|
Hi All,
Am mid-way through creation of my first binding for an Alarm panel. As with most panels, the panel has to be polled for updates. However, I have previously created a framework/model to abstract the panel an produce events when things happen.
For example, my existing framework/model runs away on its own thread and can fire an event when say a zone status (open/closed) changes.
What I am trying to figure out is the best way to translate that event into an item state update for the relevant 'thing'.
For example, I believe that I could give a reference to my bridge handler to my existing event handler and have that event handler iterate over all 'things' to see if any of their states need to be updated based on a given alarm event that has occurred, eg:
List<Thing> things = getThing().getThings();
...
...
However, this doesn't feel right or efficient! So before I go any further, I wanted to get some input from you guys to make sure I do it the 'right' way!
Any thoughts / comments appreciated.
Cheers
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05173 seconds