Basically, the vera device does not include a character encoding when responding to calls. When requests sees no character encoding, requests uses the chardet to detect the character encoding based on the raw bytes returned. As documented in the home assistant issue, this is an intensive process. To avoid this issue, we are manually setting the encoding to utf-8. This will prevent requests from using chardet.
Manually specify response encoding to avoid slowness caused by the chardet library when requests try to detect the encoding.
Documented here: https://github.com/home-assistant/core/issues/32876
Basically, the vera device does not include a character encoding when responding to calls. When
requests
sees no character encoding,requests
uses thechardet
to detect the character encoding based on the raw bytes returned. As documented in the home assistant issue, this is an intensive process. To avoid this issue, we are manually setting the encoding toutf-8
. This will prevent requests from using chardet.