Add option to align FindMyAccessories key generation#125
Add option to align FindMyAccessories key generation#125malmeloo merged 3 commits intomalmeloo:fix/accessory-key-driftfrom
Conversation
Sometimes the key generation diverges for example if the accessory has no power. FindMy solves this be re-aligning the key generation if a btle connection is established. FindMy.app stores there alignment records in the `KeyAlignmentRecord` directory. This PR extends the FindMyAccessory class to read those records during `from_plist`-generation and re-sync the key generation by this
|
That's really cool, thank you for taking the time to implement this! I had no idea Apple made it so easy to retrieve sync data. To what extent did you test this? My own setup is a bit flaky at the moment, but if you tested it extensively then I'm happy to merge it. Fetching reports before the |
|
I only tested it a bit and not with reports before the |
|
Yeah I think you're right, the index doesn't just "jump" on its own so the last known good mapping is probably the best reference point. As long as it's roughly correct it should be fine anyway, since that ~12hr margin is still used when making requests. I'll merge this once I find some time to work on the library again, the changes should be backwards compatible anyway so no existing features should break because of it. |
|
Sorry for taking a while to review this. Thanks again! |
Sometimes the key generation diverges for example if the accessory has no power. FindMy solves this be re-aligning the key generation if a btle connection is established. FindMy.app stores there alignment records in the
KeyAlignmentRecorddirectory.This PR extends the FindMyAccessory class to read those records during
from_plist-generation and re-sync the key generation by this