Skip to content
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

scanner: detect OF devices in Nearby state #50

Merged
merged 4 commits into from
Jul 21, 2024

Conversation

malmeloo
Copy link
Owner

@malmeloo malmeloo commented Jul 15, 2024

Breaking change to allow detection of 'nearby' devices that are not broadcasting full FindMy keys. These can be useful to detect whether a device is currently nearby.

Proposed API

OfflineFindingDevice is now either NearbyOfflineFindingDevice or SeparatedOfflineFindingDevice.

Both device types will have the following fields:

  • mac_address
  • status
  • discovered_at
  • additional_data

NearbyOfflineFindingDevices will have no additional unique fields.

SeparatedOfflineFindingDevices will have the following unique fields:

  • hint
  • all HasPublicKey fields (adv_key_bytes, hashed_adv_key_bytes, etc.)

Comparing devices against keys

Both subclasses will get an is_from method (name TBD) which will allow comparisons against keys and AirTag devices. The method will probably accept any HasPublicKey subclass (KeyPair, SeparatedOfflineFindingDevice) as well as any RollingKeyPairSource (FindMyAccessory). For this last one, the detection timestamp must be saved.

Resolves #46

@malmeloo malmeloo added the enhancement New feature or request label Jul 15, 2024
@malmeloo malmeloo marked this pull request as ready for review July 21, 2024 17:44
@malmeloo malmeloo merged commit 1df7db8 into main Jul 21, 2024
1 check passed
@malmeloo malmeloo deleted the feat/nearby-of-device-scanner branch July 21, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Knowing if a particular AirTag presents in the scan results?
1 participant