Skip to content
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

Added some parameters: Error code, Viomimode, Viomibintype #799

Merged
merged 3 commits into from
Nov 2, 2020
Merged
Changes from 1 commit
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
6 changes: 4 additions & 2 deletions miio/viomivacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
530: "Mop and water tank missing",
531: "Water tank is not installed",
2101: "Unsufficient battery, continuing cleaning after recharge",
2103: "Charging",
2105: "Fully charged",
Copy link
Contributor

@titilambert titilambert Aug 28, 2020

Choose a reason for hiding this comment

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

I confirm this message, I have the same one
Thanks !

}


Expand All @@ -63,7 +65,7 @@ class ViomiMode(Enum):
Vacuum = 0 # No Mop, Vacuum only
VacuumAndMop = 1
Mop = 2

Unknown = 4
Copy link
Owner

Choose a reason for hiding this comment

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

I think it would make more sense to add a log message(s) to the place(s) where the unknown mode is encountered, otherwise this looks good to go, thanks for the PR! 👍

Copy link
Owner

Choose a reason for hiding this comment

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

Ping?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand your comment, you mean a log message in the mode method ?
like here:

?

Copy link
Owner

Choose a reason for hiding this comment

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

I tried to say that it's more useful to simply log the unknown state on the call site, like done in

-- in case someone is seeing those warnings in their logs and knows what causes them, they can create a PR to fix it.

Copy link
Contributor

Choose a reason for hiding this comment

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

If @fs79 doesn't answer, I can integrate this patch in this PR (#808)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Mode 4 is something like CleanPosition.


class ViomiLanguage(Enum):
CN = 1 # Chinese (default)
Expand Down Expand Up @@ -94,7 +96,7 @@ class ViomiBinType(Enum):
Vacuum = 1
Water = 2
VacuumAndWater = 3

NoBin = 0

class ViomiWaterGrade(Enum):
Low = 11
Expand Down