itchannel / apex-ha

Local Neptune Apex HA Integration (Aquarium Controller)
GNU General Public License v3.0
19 stars 3 forks source link

Rebooting Apex loses HA connection permanently #20

Closed brettonw closed 1 year ago

brettonw commented 1 year ago

I updated the software in my Apex, and had to reboot it in the process. The HA connection was lost, and at first I thought Neptune had changed their rest API interface and broken the integration. The only way I could get it back was to remove the integration and re-add it. I subsequently rebooted the Apex again, and had the same problem. Does the login cookie need to be refreshed if an API call fails?

itchannel commented 1 year ago

Reloading the integration also works but yeah I forgot to check for an expired session cookie. Will add a simple status_code check later today.

itchannel commented 1 year ago

1.09 pre release should fix this issue I've added a check for a 401 status code and will retry obtaining a new cookie up to 3 times before giving up. (Had to add the 3 retries as at least my controller can be a little finicky with logging in)

brettonw commented 1 year ago

Confirmed Fixed.