Closed rmfalco89 closed 1 year ago
I run into this same issue frequently
@jjeaton
I run into this same issue frequently
Can you please try out my fix? https://github.com/milo526/homebridge-tuya-web/pull/537
Let me know if you need help on how to do that. You'll need to get my branch, build the plugin, install it in your homebridge's directory and restart homebridge
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I get
[TuyaWebPlatform] Authentication error: you cannot auth exceed once in 180 seconds
After which, the plugin doesn't try to re-authenticate, as far as I can tell. At least not in a short time span (i.e. minutes, not hours). As a consequence the tuya accessories are not operable through homebridge.
Steps To Reproduce I am not entirely sure what the steps would be, other than a frequent restart of homebridge as I am developing on it.
Plugin Version v1.1.3
Homebridge Config
Device Config N/A as it's not a problem with any device, it's a problem with tuya authentication
Additional Context I think that the problem comes from https://github.com/milo526/homebridge-tuya-web/blob/9ba39bd8fccb94a5fc24b2367e088b241e069d53/src/api/service.ts#L198
Here you check for an exact error match. I am not sure whether they changed the Tuya API behavior in terms of error string returned, but now I'm seeing 180 instead of 60 in that same error string (as per title of this Issue).
Something I didn't get to understand is why throwing an error if there isn't a valid token, rather than getting a new one or refreshing it. E.g. here: https://github.com/milo526/homebridge-tuya-web/blob/9ba39bd8fccb94a5fc24b2367e088b241e069d53/src/api/service.ts#L41
This is more for my personal understanding than anything else.
I also have a potential fix ready. Sorry I don't speak typescript or javascript and I'm sure my fix sucks but I hope it gives you a good pointer and a potential solution to a more general problem with authentication. I'll link the PR here as soon as I can test it out.
Thanks!!