sirkirby / ha-udm-rule-manager

Allows you to manage your UDM firewall and traffic rules in Home Assistant
https://chriskirby.net/automate-your-unifi-network-firewall-and-traffic-rules-with-home-assistant/
MIT License
9 stars 1 forks source link

Refresh login token and cookie at a regular interval #2

Closed sirkirby closed 2 months ago

sirkirby commented 2 months ago

Describe the bug After adding the integration in the initial polling of rules, they are never re-pulled. The integration should either regularly login to get a fresh token or pull the rules at a regular interval to ensure the login stays active...or both

To Reproduce Steps to reproduce the behavior:

  1. Add the integration and wait 24 hours then try to toggle a rule. 401 error.

Expected behavior Rule toggle should work as expected without receiving a 401 error

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional

Integration should maintain an active session with the UDM, preventing the 401. Or if a 401 is received it should automatically login and then perform the toggle.