findmy.scanner#

Utilities related to physically discoverable FindMy-devices.

Submodules#

Classes#

NearbyOfflineFindingDevice

Offline-Finding device in nearby state.

OfflineFindingScanner

BLE scanner that searches for :meth:`OfflineFindingDevice`s.

SeparatedOfflineFindingDevice

Offline-Finding device in separated state.

Package Contents#

class findmy.scanner.NearbyOfflineFindingDevice(mac_bytes: bytes, status_byte: int, first_adv_key_bytes: bytes, detected_at: datetime.datetime, additional_data: dict[Any, Any] | None = None)#

Bases: OfflineFindingDevice

Inheritance diagram of findmy.scanner.NearbyOfflineFindingDevice

Offline-Finding device in nearby state.

OF_PAYLOAD_LEN = 2#
is_from(other_device: findmy.keys.HasPublicKey | findmy.accessory.RollingKeyPairSource) bool#

Check whether the OF device’s identity originates from a specific key source.

classmethod from_payload(mac_address: str, payload: bytes, detected_at: datetime.datetime, additional_data: dict[Any, Any] | None = None) NearbyOfflineFindingDevice | None#

Get a NearbyOfflineFindingDevice object from an OF message payload.

class findmy.scanner.OfflineFindingScanner(loop: asyncio.AbstractEventLoop)#

BLE scanner that searches for :meth:`OfflineFindingDevice`s.

BLE_COMPANY_APPLE = 76#
classmethod create() OfflineFindingScanner#
Async:

Create an instance of the scanner.

async scan_for(timeout: float = 10, *, extend_timeout: bool = False) collections.abc.AsyncGenerator[OfflineFindingDevice, None]#

Scan for OfflineFindingDevice`s for up to :meth:`timeout() seconds.

If extend_timeout() is set, the timer will be extended by timeout() seconds every time a new device is discovered.

class findmy.scanner.SeparatedOfflineFindingDevice(mac_bytes: bytes, status: int, public_key: bytes, hint: int, detected_at: datetime.datetime, additional_data: dict[Any, Any] | None = None)#

Bases: OfflineFindingDevice, findmy.keys.HasPublicKey

Inheritance diagram of findmy.scanner.SeparatedOfflineFindingDevice

Offline-Finding device in separated state.

OF_PAYLOAD_LEN = 25#
property hint: int#

Hint value as reported by the device.

property adv_key_bytes: bytes#

See HasPublicKey.adv_key_bytes().

is_from(other_device: findmy.keys.HasPublicKey | findmy.accessory.RollingKeyPairSource) bool#

Check whether the OF device’s identity originates from a specific key source.

classmethod from_payload(mac_address: str, payload: bytes, detected_at: datetime.datetime, additional_data: dict[Any, Any] | None = None) SeparatedOfflineFindingDevice | None#

Get a SeparatedOfflineFindingDevice object from an OF message payload.

__repr__() str#

Human-readable string representation of an OfflineFindingDevice.