mirror of
https://github.com/malmeloo/FindMy.py.git
synced 2026-04-18 00:53:56 +02:00
30 lines
815 B
Python
30 lines
815 B
Python
# ruff: noqa: T201, D103
|
|
import asyncio
|
|
import logging
|
|
|
|
from findmy.scanner import OfflineFindingScanner
|
|
|
|
logging.basicConfig(level=logging.INFO)
|
|
|
|
|
|
async def scan() -> None:
|
|
scanner = await OfflineFindingScanner.create()
|
|
|
|
print("Scanning for FindMy-devices...")
|
|
print()
|
|
|
|
async for device in scanner.scan_for(10, extend_timeout=True):
|
|
print(f"Device - {device.mac_address}")
|
|
print(f" Public key: {device.adv_key_b64}")
|
|
print(f" Lookup key: {device.hashed_adv_key_b64}")
|
|
print(f" Status byte: {device.status:x}")
|
|
print(f" Hint byte: {device.hint:x}")
|
|
print(" Extra data:")
|
|
for k, v in sorted(device.additional_data.items()):
|
|
print(f" {k:20}: {v}")
|
|
print()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(scan())
|