-
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
Automatically update pairings data when its stale #72
Comments
Of course if we do that, do we need to make the Controller automatically save the updated pairings data? |
Part of the same logic would be to have a version number for this library too - specifically for the pairing file format code - so that we can detect changes like #71 where we actually want to repopulate the pairing data. |
I think this affects both type of accessories: 6.4.2 of the spec is for BLE where is 5.4 also has
The following steps would be required:
|
I think its easier for BLE, as we can easily parse the MfrData from within the scope of a connection to a mac address - we don't have to invoke discovery. I'm unsure about how to approach it for the IP transport though. There was a PR to decouple IP connections from discovery because they were slow. In the land of home assistant i would be able to pass in the current CN/C# from discovery into get_pairing, and that would avoid having to invoke discovery a 2nd time. That feels kind of dirty, though. I was going to put together a PR that:
I wasn't going to touch IP devices yet - and I think its safe to do them seperately/later as the IP backend always refreshes the pairing data when you call list_accessories_and_chars. Does that sound acceptable? |
yes sounds like a plan to be considered |
We remember all the discovered BLE characteristics in the pairing file. Do we need to be able to invalidate that cache? Does this need changes to the controller API or the connections between discovery and the controller?
E.g. It looks like if you upgrade the firmware (which might add new characteristics?) then the CN number in the ManufacturerData would go up. Should we remember the CN in the pairing file and repopulate it on connection if the number has changed?
For reference, 6.4.22 of the spec says:
The text was updated successfully, but these errors were encountered: