jdomeij / node-red-contrib-node-lifx

Node RED nodes for controlling Lifx lights
Apache License 2.0
7 stars 9 forks source link

Fix infrared capable lights not being listed when IR state request fails #5

Closed ristomatti closed 6 years ago

ristomatti commented 7 years ago

I have nine LIFX lights of which two are IR capable. The two lights were not listed in the node editor with but they were found by node-lifx (found this out with some debug prints). The issue seems to be that light.getMaxIR() times out and returns an error and due to that the light never gets added on the list of lights. The pull request fixes the issue by emitting a warning once during init instead of passing the error forward with the callback. The solution is not exactly beautiful but at least allows using the lights which otherwise could not be used.

The light.maxIR(value) does seem to work though so I would not disable the IR capability altogether. I'm a collaborator on the node-lifx project and I believe this is an issue there rather than with this package. The getMaxIR() call does not return any value. I'll create an issue to node-lifx on this. My guess is that it has broken with some recent firmware update.

Unfortunately I could not think of a good way to unit test this change but the current tests pass after the change at least. If this PR is ok and you can suggest a way to test this, I can update the PR with such test.

ristomatti commented 6 years ago

Closed assuming this is resolved by d8eea85.