Skip to content

Add better timestamp support to cleanrecords module #1463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2025

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.

2 participants