Skip to content

Commit af2eb89

Browse files
committed
Revert "Revert priority-comparing, as suggested"
This reverts commit d2cc880.
1 parent ba0a021 commit af2eb89

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugwise_usb/messages/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,28 +83,28 @@ def __gt__(self, other: PlugwiseMessage) -> bool:
8383
if self.seq_id is not None and other.seq_id is not None:
8484
return self.seq_id < other.seq_id
8585
return self.timestamp > other.timestamp
86-
return self.priority.value > other.priority.value
86+
return self.priority.value < other.priority.value
8787

8888
def __lt__(self, other: PlugwiseMessage) -> bool:
8989
"""Less than."""
9090
if self.priority.value == other.priority.value:
9191
if self.seq_id is not None and other.seq_id is not None:
9292
return self.seq_id > other.seq_id
9393
return self.timestamp < other.timestamp
94-
return self.priority.value < other.priority.value
94+
return self.priority.value > other.priority.value
9595

9696
def __ge__(self, other: PlugwiseMessage) -> bool:
9797
"""Greater than or equal."""
9898
if self.priority.value == other.priority.value:
9999
if self.seq_id is not None and other.seq_id is not None:
100100
return self.seq_id < other.seq_id
101101
return self.timestamp >= other.timestamp
102-
return self.priority.value > other.priority.value
102+
return self.priority.value < other.priority.value
103103

104104
def __le__(self, other: PlugwiseMessage) -> bool:
105105
"""Less than or equal."""
106106
if self.priority.value == other.priority.value:
107107
if self.seq_id is not None and other.seq_id is not None:
108108
return self.seq_id <= other.seq_id
109109
return self.timestamp <= other.timestamp
110-
return self.priority.value < other.priority.value
110+
return self.priority.value > other.priority.value

0 commit comments

Comments
 (0)