First attempt to run an action fails
The first attempt to run an action when the service is "cold started" always seems to fail. For example, a simple "power on" task will do nothing when first executed, but when tried again, works fine.
Not sure why this happens. According to the log, FireReceiver is never run by Tasker, but for some reason LIFXService starts and begins bulb discovery. Seems like some sort of Android bug? A misconfiguration somewhere?
After some investigation, this seems to be some Android bug or some such.
When ReceiverService attempt to create a connection to LIFXService via bindService(), LIFXService reliably starts without any trouble, but sometimes (usually on the first run) the ServiceConnection never has its onServiceConnected() method called. For whatever reason this doesn't occur when LIFXService is already loaded and running.
The current workaround (added in 148d24c7b3b11554f5aac3719efd52f4d1bc17b1) is to keep trying to run bindService until it works. This seems to solve the issue but is ... less than ideal, to say the least. I'm keeping this open for now in hopes that I can properly solve the issue.