jlusiardi / homekit_python

A python implementation to work as both HomeKit controller and accessory.
Apache License 2.0
221 stars 41 forks source link

conflicted pair method types values #204

Closed ashrafyassin closed 4 years ago

ashrafyassin commented 4 years ago

I'm having issues pairing my accessory to the controller, it's seems that the pairing method is not supported by the accessory, while looking at the code i noticed a conflict in the values stated in file homekit/protocol/methods.py and the HAP-spec. For example in HAP-spec, the PairSetup is 0, while in methods.py it is 1.

Screen Shot 2020-08-05 at 23 11 28

I dont know if the spec that i have is 100% accurate since it's Non-Commercial, can anyone confirm which values are the correct ones.

Jc2k commented 4 years ago

https://github.com/jlusiardi/homekit_python/issues/170 might help.

I think our constant is set based on an earlier version of the spec that predates soft auth (i.e. when all devices had an apple chip).

Some devices work if you pass 0, some work if you pass 1. There is no definitive documentation on which to use when. My theory was if the zeroconf data sets bit 1 on ff (the SupportsAppleAuthenticationCoprocessor flag) then it should be 1, otherwise it should be 0. But in practice it seems to be that iOS will pass 0 if no bits are set on ff, otherwise it will use 1.

There are some devices that seem to support neither scheme though.