Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add better timestamp support to cleanrecords module#1463

Merged
sdb9696 merged 1 commit into
feat/vacuum_consumablespython-kasa/python-kasa:feat/vacuum_consumablesfrom
feat/vacuum_records_timestamppython-kasa/python-kasa:feat/vacuum_records_timestampCopy head branch name to clipboard
Jan 20, 2025
Merged

Add better timestamp support to cleanrecords module#1463
sdb9696 merged 1 commit into
feat/vacuum_consumablespython-kasa/python-kasa:feat/vacuum_consumablesfrom
feat/vacuum_records_timestamppython-kasa/python-kasa:feat/vacuum_records_timestampCopy head branch name to clipboard

Conversation

@sdb9696
Copy link
Copy Markdown
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
Copy Markdown
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 thread kasa/smart/smartdevice.py
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
Copy Markdown
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
@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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.