HAP-python icon indicating copy to clipboard operation
HAP-python copied to clipboard

Late-import base36 and QR code libraries; remove SUPPORT_QR_CODE flag

Open akx opened this issue 2 years ago • 0 comments

Some tests run locally for home-assistant/core would fail with a cryptic "base36 is not defined" error if that library was not installed.

This PR:

  • makes that error message cleaner – it's now a RuntimeError that has the import error as a reason
  • makes pyhap not import base36 or QRCode at all until they are needed
    • in doing that removes the SUPPORT_QR_CODE flag; based on GitHub Code Search there are no external users for that flag that I can see.

akx avatar Nov 27 '23 13:11 akx