I believe this should replace the current app on the app store "TCP Bulbs (connect)" as it's a more reliable integration.
I did a couple of things to make this more reliable:
- I re-fetch the authorization token every 5 minutes
- If a request fails, I again re-try to fetch the token and re-submit the request
- I try again on 400 errors in addition to 500 and 401 errors.
Code is all open source under Apache 2.0 license.