refactor: abstraction for plist reading

This commit is contained in:
Mike A.
2025-08-07 21:02:55 +02:00
parent 64347b942c
commit f771ad97d5
3 changed files with 38 additions and 23 deletions

View File

@@ -33,13 +33,7 @@ logging.basicConfig(level=logging.INFO)
def main(plist_path: Path, alignment_plist_path: Path | None) -> int:
# Step 0: create an accessory key generator
with plist_path.open("rb") as f:
f2 = alignment_plist_path.open("rb") if alignment_plist_path else None
airtag = FindMyAccessory.from_plist(f, f2)
if f2:
f2.close()
airtag = FindMyAccessory.from_plist(plist_path, alignment_plist_path)
# Step 1: log into an Apple account
print("Logging into account")