Skip to content

Conversation

@sdb9696
Copy link
Collaborator

@sdb9696 sdb9696 commented Jan 17, 2025

No description provided.

Comment on lines -51 to -59
def deserialize(self, value: list[int]) -> Record:
"""Deserialize list of maps into a dict."""
data = {
"timestamp": value[0],
"clean_time": value[1],
"clean_area": value[2],
"dust_collection": value[3],
}
return Record.from_dict(data)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work with the timezone dialect so moved this logic to __pre_deserialize__.

Comment on lines +451 to +454
# We move time to the beginning so other modules can access the
# time and timezone after update if required. e.g. cleanrecords
if Time.__name__ in self._modules:
self._modules.move_to_end(Time.__name__, last=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh, this feels rather icky and I would rather like to avoid it, but I suppose it is what it is :-)

@sdb9696 sdb9696 merged commit c6a12a4 into feat/vacuum_consumables Jan 20, 2025
1 check passed
@sdb9696 sdb9696 deleted the feat/vacuum_records_timestamp branch January 20, 2025 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants