You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Setup hangs: userinfo request has no timeout and no browser User-Agent #50
Problem
Adding the integration: login succeeds, but setup never finishes. The config entry
setup is eventually cancelled ("Setup of config entry … for postnl integration cancelled")
and no entities are created.
Debug log shows it stops at PostNLLoginAPI.userinfo() (login_api.py).
That request uses a plain requests.Session:
- no timeout, so a stalled connection blocks setup forever
- no User-Agent, so it is sent as "python-requests/x.y"
The login flow in auth.py does send a browser User-Agent, and works fine.
Fix that worked for me (login_api.py)
- add the same browser User-Agent as auth.py (_USER_AGENT) to the session headers,
plus "Accept: application/json"
- add timeout=(10, 30) to the userinfo GET
After this change and a restart, setup completes immediately and all sensors load.
Probably worth applying the same timeout/User-Agent to the other requests-based calls.
Activity
fix: stop setup hanging on the userinfo call (#50)
peter-mdf commentedon Nov 14, 2026
Thanks for the report @renef79 . It's indeed a bug, so well spotted. Fixed in the next version :)