FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add better timestamp support to cleanrecords module by sdb9696 · Pull Request #1463 · python-kasa/python-kasa · GitHub

Repository navigation

Add better timestamp support to cleanrecords module - #1463

Merged
sdb9696 merged 1 commit into
feat/vacuum_consumablesfrom
feat/vacuum_records_timestamp
Jan 20, 2025
Merged

sdb9696 merged 1 commit into
feat/vacuum_consumablesfrom
feat/vacuum_records_timestamp

Conversation

sdb9696 commented Jan 17, 2025

Copy link
Copy Markdown
Contributor

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
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

sdb9696 merged commit c6a12a4 into feat/vacuum_consumables Jan 20, 2025
sdb9696 deleted the feat/vacuum_records_timestamp branch January 20, 2025 10:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL