Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LightCollection Listener - lightCollectionDidAddLight returning bad labels #6

Open
Cakey123445 opened this issue May 7, 2014 · 2 comments

Comments

@Cakey123445
Copy link
Contributor

I've set a listener on context.getAllLightsCollection() and whilst it's getting called correctly the arg0 & arg1 elements are returning bad labels ("Unknown"), if I use the arg1 (LFXLight) and choose getLabel() it will always return "Unknown" as will the collection in arg0 when the listener is called.

However when I iterate the LFXLightCollection in arg0 I will find that previous lights that did gave label "Unknown" are now correct, and if I force a short delay and call context.getAllLightsCollection() again then all labels are now correct.

I've also got a listener on change label but that never gets called.

Surely lightCollectionDidAddLight should only be called once the label is known OR called again when the label is known.

Any chance of a fix? or is this just me?

@ThomasWrobel
Copy link

Not just you, I get this occasionally too. Seems inconsistent but for me maybe it fails 1 time out of 10, so it isnt too bad, but still not a good user experience when it does happen.

One (very crude) workaround I guess is to maintain a internal hashmap of labels against IDs in your app, so when it does work it remembers them for when it doesn't.

@Cakey123445
Copy link
Contributor Author

I've put in a kludgey fix for the moment of starting a runnable and doing my light update 500mS after the add light occurs, the minimum to pick up the right label was 400mS after the DidAddLight callback.
Have sent a support ticket to LIFX but no response yet....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants