RobertD502 / home-assistant-iocare

Home Assistant custom component for monitoring and controlling Coway Airmega Purifiers
MIT License
50 stars 8 forks source link

Addon v0.4.1 requires reauth with Coway servers every few hours #43

Closed pcmoore closed 5 months ago

pcmoore commented 5 months ago

Since updating to version 0.4.1 of the addon it requires reauthentication every few hours, selecting (or not selecting) "skip password change" seems to have no affect.

Additional HA information: HA core: 2024.4.4 HA supervisor: 2024.04.4 HA OS: 12.2 HA frontend: 20240404.2

RobertD502 commented 5 months ago

They have started making tokens only valid for an hour. I already have reauthentication setup so there isn't any loss in functionality, but need to remove the warning since it unnecessarily clogs up user logs.

This will be taken care of in the next release.

pcmoore commented 5 months ago

Thanks. Would you prefer if I kept this issue open as a FYI to others who may ask the same thing, or would you prefer it closed?

RobertD502 commented 5 months ago

Feel free to keep it open. It will be automatically closed when I link a PR, containing the fix, to this issue.

RobertD502 commented 5 months ago

@pcmoore Update to 0.4.2 and the warning messages will be gone - I've revamped the logic in the backend to track both the token expiry time and to use the refresh token to fetch a new token instead of doing a new "log in" to fetch a new set of tokens.

pcmoore commented 5 months ago

A quick note to confirm that after running with v0.4.2 for several hours the errors/warnings are indeed gone. Thanks again for your work on this.