Added simple generic x-user-agent to prevent from being blocked ("quota")#743
Conversation
|
Nice, thank you! Cannot test it right now, I assume you have it running already? Does it also work with the 5 minute interval in Home Assistant? |
|
@rikroe yes, it works since yesterday with standard polling flawless on my side. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #743 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 17 17
Lines 1431 1476 +45
=========================================
+ Hits 1431 1476 +45
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks, could you please exclude |
|
arrrg... formatting. I'll check it. |
|
Could be that this is ruff's way of telling the world I have neglected this too long. And you have to deal with it, sorry! |
|
Haha... don't worry. Fixed! |
Breaking change
n/a
Proposed change
Added simple generic
x-user-agentto prevent from being blocked ("quota exceeded").BMW has apparently introduced a quota for HTTP requests, which are counted based on the HTTP header
x-user-agent. Because this header key is hard-coded into the code and this integration is very popular, the server-side threshold may be exceeded under certain circumstances.To prevent this, part of the
x-user-agentis now generated dynamically. The same x-user-agent should now always be generated for each installation (server, container).Type of change
Additional information
n/a
Checklist
Testcase
My home-assistant instance is running as an LXC using Proxmox Linux (ha-container with portainer).
bimmer_connectedon your LXC/usr/local/lib/python3.13/site-packages/bimmer_connected(in my case)x-user-agentis now managed "under the hood".