Skip to content

Commit ec279ef

Browse files
Andrew YeatsAndrew Yeats
authored andcommitted
review: call the static parse_record via the class, not self
Follow-up to the committed suggestion: parse_record is a @staticmethod, so call it as CleanRecordConverter.parse_record(...) rather than self.parse_record(...).
1 parent 96ead47 commit ec279ef

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

roborock/devices/traits/b01/q10/clean_history.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ def parse(self, envelope: dict[str, Any]) -> CleanRecordPush | None:
6464
ignore it without changing state). Malformed individual records are skipped.
6565
"""
6666
if envelope.get("op") == "notify":
67-
record = self.parse_record(envelope.get("id"))
67+
record = CleanRecordConverter.parse_record(envelope.get("id"))
6868
return CleanRecordPush([record], replace=False) if record is not None else None
6969
data = envelope.get("data")
7070
if not isinstance(data, list):
7171
return None
72-
records = [record for item in data if (record := self.parse_record(item)) is not None]
72+
records = [record for item in data if (record := CleanRecordConverter.parse_record(item)) is not None]
7373
return CleanRecordPush(records, replace=True)
7474

7575
@staticmethod

0 commit comments

Comments
 (0)