-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unknown error on initial pair setup #12
Comments
I've previously played with a couple of Homekit devices that were very picky about header ordering, so I don't know if that could be contributing. I don't have a convenient iOS device - I'll try to find one so I can see what the functioning pairing looks like |
Ok, that doesn't seem to be it - sending an apparently identical request using curl (mocking up the same headers and ordering gives a more reasonable response. |
i just looked into your dump of pairing3. instead of
Perhaps i missed that in the documentation or IKEA Tradfi just relies on it. |
The problem is because http.client (in 3.5, at least) sends the headers and the body as separate packets, and this device mishandles the case. Monkey-patching http.client to send in a single packet fixes it. |
is this something to be fixed within this project? |
I don't think it can easily be fixed there, but I'll think about it some more |
@mjg59 I'm running into this issue as well on a Leviton switch, could you give some detail on what you had to "monkey-patch"? (can't say I've heard that term before, I'm not much of a programer though :) ) |
@nickpl456 Monkey Patching in Python refers to replacing a method in an imported module with your own method. In Home Assistant I have this:
and then later do:
to replace the _send_output function with my own. If you do that at the start of your code you ought to be able to get further. |
I just tried to fix the issue without changing the behavior of the original |
Just tested out 61bf4e9 and it works great, I'm able to successfully pair with and control my Leviton switch, thanks guys! |
I think you need to add an extra (and unused) named argument for 3.6 compatibility - see mjg59/home-assistant@705b430 |
(But otherwise this looks good!) |
thanks for the hint for python 3.6 @mjg59. So either way of patching this will be an ongoing process, I guess. |
I would close this as done then. |
Trying to pair with an Ikea Tradfri running the latest (Homekit-compatible) firmware:
Step #3: unkown error
Packet dump of the transaction attached
pairing.zip
The text was updated successfully, but these errors were encountered: