File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -373,6 +373,22 @@ def from_json(
373373 msg = f"Failed to restore account data: { e } "
374374 raise ValueError (msg ) from None
375375
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+ @override
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+
376392
377393class _AccessoryKeyGenerator (KeyGenerator [KeyPair ]):
378394 """KeyPair generator. Uses the same algorithm internally as FindMy accessories do."""
You can’t perform that action at this time.
0 commit comments