How can I remove the Thing in Binding? [message #1511803] |
Mon, 15 December 2014 02:10  |
Eclipse User |
|
|
|
Hi,
I want to create my binding having one bridge, and many things.
I reference the Hue Binding, so I can add discovered bridge and things.
But I want to remove the things in BridgeHandler when I push the button (receive command)
In this way,
Is it right flow in Binding?
1. reference ManagedThingProvider in HandlerFactory
2. when BridgeHandler receive command,
3. call ThingHandler function(ex, onThingRemoved)
4. in ThingHandler function onThingRemoved()
-> managedThingProvider.remove(getThing().getUID())
or is another way to remove the thing in Binding BridgeHandler?
I think this is not smooth, so could you explain the right way for me?
regards,
Keven.
|
|
|
|
|
|
Re: How can I remove the Thing in Binding? [message #1513191 is a reply to message #1513159] |
Tue, 16 December 2014 04:52   |
Eclipse User |
|
|
|
Denis,
I think Kevin wants to keep the real world in sync with the abstract ESH world. Since discovery is about adding devices, logically, you would also expect the runtime to be able to deal with the disappearance of devices.
btw, this is something we are also struggling with in the Sonos 2.0 UPNP based binding, where there is a requirement to detect the removal of a Sonos device, but for which we now have to implement a separate polling/is-alive process.
I understand we keep track of disappeared devices as we set the status to OFFLINE, but changing the state to OFFLINE implies a detection mechanism. So, do we keep track of a device and flag it OFFLINE (and a user is aware that a device existed/was online at a given point in time), or do we remove disappeared devices altogether? I am not sure that either scenario is perfect, e.g. environments with lots of things, or fast changing networks (for example, part of zigbee/zwave/... mesh disappearing suddenly,...)
K
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.11006 seconds