UniversalDevicesInc-PG3 / udi-presenceUnifi-nodeserver

UniFi Device Network Presence Detection.
GNU General Public License v3.0
0 stars 1 forks source link

Issue#2 Fix handling of python requests when authentication has expired. #3

Closed SamMcDowell closed 10 months ago

SamMcDowell commented 10 months ago

The Unifi controller code was not properly handling the auth failure that occurs ~2 hrs after prior authentication. Since the code already had some level of retries built in, it just needed to be properly triggered. To address that:

  1. Direct all responses to raise an exception on all status codes
  2. Ensure the retry logic catches the HTTPError exception and triggers the retry/re-auth

I've also removed the python-pushover from the requirements.txt since it's not used AND fixed a comparison operation.

My eisy has been running with these changes in my dev environment for over a week now with no issues.