HueSDK icon indicating copy to clipboard operation
HueSDK copied to clipboard

BridgeStateUpdatedCallback fires two times for one update

Open jeroenbeuz opened this issue 6 years ago • 1 comments

Whenever I update a single light state I get the first bridgeStateUpdateEvent callback after a couple of miliseconds. This is great, but then after about 2 seconds another bridgeStateUpdateEvent is called. I know for sure my action only ececuted once and there's nobody else communicating with my bridge. This is quite annoying since I update my UI based on these callbacks. Now for every action I send to the bridge I get two state update callbacks, and one is fired only after 2 seconds.

This is how I build my bridge object:

Bridge bridge = new BridgeUtils().getBridgeBuilder()
                .setBridgeId(bridgeUID)
                .setIpAddress(bridgeIp)
                .setConnectionType(connectionType)
                .setBridgeConnectionCallback(bridgeConnectionCallback)
                .addBridgeStateUpdatedCallback(bridgeStateUpdatedCallback)
                .build();

And this is how I update the light state:

light.updateState(lightState);

Bridge info: BSB0002 with software version 1802201122 (latest available update)

jeroenbeuz avatar Apr 25 '18 09:04 jeroenbeuz

Which events do you get ? Are they the same ? I assume that you don't have a heartbeat running in the background ?

jhvdb87 avatar Apr 30 '18 18:04 jhvdb87