Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion roborock/data/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ def _decamelize(s: str):
s = re.sub(r"(?<=[a-z0-9])([A-Z])", r"_\1", s)
s = re.sub(r"([A-Z]+)([A-Z][a-z])", r"\1_\2", s) # Split acronyms followed by normal camelCase
s = re.sub(r"([a-zA-Z])([0-9]+)", r"\1_\2", s)
return s.lower()
s = s.lower()
# Temporary fix to avoid breaking any serialization.
s = s.replace("base_64", "base64")
return s
Comment on lines +35 to +38
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Very targetted and not ideal

Issue to track here: #644

Copy link
Contributor

Choose a reason for hiding this comment

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

The current set of tests should be exhaustive, so you can break anything that is not tested.

Copy link
Contributor

Choose a reason for hiding this comment

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

This regexp was modified to match the names in device features so if we just want to change field names in device features it should not be a problem to change. Agree with this change that making serialization work is more important in the short term.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will reference this in issue for tracking. Will merge for now



def _attr_repr(obj: Any) -> str:
Expand Down
Loading