-
-
Notifications
You must be signed in to change notification settings - Fork 569
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
Conversation
added: error codes 2103: "Charging", 2105: "Fully charged" saw the 4 but don´t know what it means, but so no error message in cli command class ViomiMode(Enum): Unknown = 4 class ViomiBinType(Enum): NoBin = 0
miio/viomivacuum.py
Outdated
@@ -63,7 +65,7 @@ class ViomiMode(Enum): | |||
Vacuum = 0 # No Mop, Vacuum only | |||
VacuumAndMop = 1 | |||
Mop = 2 | |||
|
|||
Unknown = 4 |
There was a problem hiding this comment.
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! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping?
There was a problem hiding this comment.
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:
python-miio/miio/viomivacuum.py
Line 145 in 5a3f2f4
""" |
There was a problem hiding this comment.
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
python-miio/miio/viomivacuum.py
Line 125 in 5a3f2f4
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
.
@@ -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", |
There was a problem hiding this comment.
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 !
I‘m fine with logging the unknown state. Would you do it in general for unknown states in all the outputs or only for the above mentioned vacuum/mop/... state? |
Yes, I think it makes sense to log all unknown cases to avoid potential exceptions. Btw, if you want to parse the command line output, you may be interested in checking out the |
@rytilahti |
Yeah, I think |
Issue for the -o json_pretty issue with viomivacuum cleaner. |
…#799) * Error code, Viomimode, Viomibintype added: error codes 2103: "Charging", 2105: "Fully charged" saw the 4 but don´t know what it means, but so no error message in cli command class ViomiMode(Enum): Unknown = 4 class ViomiBinType(Enum): NoBin = 0 * Make operation modes complete * Fix lint issue Co-authored-by: Sebastian Muszynski <basti@linkt.de>
added:
error codes
2103: "Charging",
2105: "Fully charged"
saw the 4 but don´t know what it means, but so no error message in cli command
class ViomiMode(Enum):
Unknown = 4
class ViomiBinType(Enum):
NoBin = 0