RobertD502 / home-assistant-flair

Custom component for Home Assistant Core for Flair pucks, vents, rooms, structures, and minisplits
MIT License
87 stars 12 forks source link

asked for OAuth 2.0 credentials every restart #35

Closed sco0ts closed 1 year ago

sco0ts commented 1 year ago

Every time I restart my HA instance, I am asked to re-enter my OAuth 2.0 credentials. They are accepted and all is well till next restart.

RobertD502 commented 1 year ago

Can you post some screenshots and logs that are related to this.

poindexter12 commented 1 year ago

this is happening to me as well:

Screen Shot 2022-09-29 at 9 37 41 PM
RobertD502 commented 1 year ago

this is happening to me as well:

Screen Shot 2022-09-29 at 9 37 41 PM

Just to confirm, are you reauthenticating with OAuth 2.0 credentials?

poindexter12 commented 1 year ago

this is happening to me as well:

Screen Shot 2022-09-29 at 9 37 41 PM

Just to confirm, are you reauthenticating with OAuth 2.0 credentials?

yep. like @sco0ts mentioned, it all authenticates fine when prompted. as soon as I reboot, I get asked again.

RobertD502 commented 1 year ago

If you send your credentials to flairhass at gmail.com I'll be able to see if I can recreate the problem / determine what is causing it.

RobertD502 commented 1 year ago

@poindexter12 Disregard previous reply. Am I correct in assuming you didn't follow the "Fresh Method" in the release notes?

If that's the case, I forgot to set the config entry version to 2 after reauthentication which results in the reauth flow getting activated each time Home Assistant is restarted as it sees the config entry as having version equal to 1.

This doesn't happen when following the Fresh Method from the release notes as the version is properly set. Regardless, I'll be pushing out a fix tomorrow to stop this from happening for those that choose to go down the reauth and manually deleting old entities path instead of fresh install path.

RobertD502 commented 1 year ago

@sco0ts @poindexter12

The issue has been fixed in the latest 0.1.2 release. After updating and restarting Home Assistant, you will once again be asked to reauthorize. However, this will be the final time that you will need to do that.

poindexter12 commented 1 year ago

@sco0ts @poindexter12

The issue has been fixed in the latest 0.1.2 release. After updating and restarting Home Assistant, you will once again be asked to reauthorize. However, this will be the final time that you will need to do that.

@RobertD502 thanks for the quick fix here. just got around to updating and testing it. all is good for me. appreciate this HA integration and the work you've done. 👍 🙏

RobertD502 commented 1 year ago

@poindexter12 Not a problem at all!

I also realized a unique ID isn't set for the config entry when reauthentcation is used instead of a fresh install after updating to the OAuth2.0 releases. It doesn't change the functionality of the integration, but I'll get an update out for that as well.

Thanks for bringing this to my attention.