Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Only auth on enter_learning in response to errors for broadlink #27341
For a while now, multiple issues (#25943, #27213) have mentioned that learning new IR commands fails on the broadlink integration. I tracked this down to the fact that the auth() method seems to return False for all executions except the very first one (which happens during the switch component setup).
Related issue (if applicable): fixes #27213
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
If the code does not interact with devices:
@pvizeli while I understand the argument that maybe the library is what needs to be fixed (it isn't clear to me if the expectation is for auth() to always return True or not since the API is not very strictly documented) but I don't see why the logic during enter_learning should be different from the logic used on send_packet.
I think this both makes the code more consistent (even if slightly more complex) and works around this bug. What do you think?
@springstan to be honest, I don't think so.
I used a clean virtualenv and installed the stuff in requirements-all.txt from homeassistant so the cryptography dependency set there seems to work fine (even though it doesn't match the version required by broadlink-python). My system already had openssl 1.1.1 installed and I didn't do any weird dynamic loading changes or symlink libraries.
I can't be sure in #25943 there wasn't another issue at the same time but it's not all related to the logic I'm fixing here.