diff --git a/lib/logitech/unifying_receiver/receiver.py b/lib/logitech/unifying_receiver/receiver.py index 551d2b55..8e7fd564 100644 --- a/lib/logitech/unifying_receiver/receiver.py +++ b/lib/logitech/unifying_receiver/receiver.py @@ -181,10 +181,10 @@ class PairedDevice(object): __int__ = __index__ def __eq__(self, other): - return self.serial == other.serial + return other is not None and self.kind == other.kind and self.serial == other.serial def __ne__(self, other): - return self.serial != other.serial + return other is None or self.kind != other.kind or self.serial != other.serial def __hash__(self): return self.serial.__hash__() @@ -359,6 +359,15 @@ class Receiver(object): return self.__contains__(dev.number) + def __eq__(self, other): + return other is not None and self.kind == other.kind and self.path == other.path + + def __ne__(self, other): + return other is None or self.kind != other.kind or self.path != other.path + + def __hash__(self): + return self.path.__hash__() + def __str__(self): return self._str __unicode__ = __repr__ = __str__