PhilipsHue / HueSDK

Philips Hue Software Development Kit
98 stars 39 forks source link

BridgeStateUpdatedCallback fires two times for one update #30

Open jeroenbeuz opened 6 years ago

jeroenbeuz commented 6 years ago

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)

jhvdb87 commented 6 years ago

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