We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 35c1945 + c1e7673 commit 2dd185bCopy full SHA for 2dd185b
1 file changed
findmy/accessory.py
@@ -373,6 +373,22 @@ def from_json(
373
msg = f"Failed to restore account data: {e}"
374
raise ValueError(msg) from None
375
376
+ @override
377
+ def __hash__(self) -> int:
378
+ master = crypto.bytes_to_int(self.master_key)
379
+ skn = crypto.bytes_to_int(self.skn)
380
+ sks = crypto.bytes_to_int(self.sks)
381
+ return hash((master, skn, sks))
382
+
383
384
+ def __eq__(self, other: object) -> bool:
385
+ if not isinstance(other, FindMyAccessory):
386
+ return False
387
388
+ return (
389
+ self.master_key == other.master_key and self.skn == other.skn and self.sks == other.sks
390
+ )
391
392
393
class _AccessoryKeyGenerator(KeyGenerator[KeyPair]):
394
"""KeyPair generator. Uses the same algorithm internally as FindMy accessories do."""
0 commit comments