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

Add last_clean_details to return information from the last clean #395

Merged
merged 2 commits into from
Oct 31, 2018

Conversation

rytilahti
Copy link
Owner

Reasoning: sometimes it is useful to get information from the last clean up (e.g. its start time for UIs). Furthermore, as far as I know one is getting always details for a single cleaning, so there's no need to keep it wrapped in a list, simplifying the downstream usage. In case there are multiple details, a warning is printed out so we can adjust this if need to be.

This involves also refactoring clean_details() to return the results unwrapped.
For the time being the default behavior will remain the same as it was (wrapped),
but a deprecation warning will be raised.

I'm expecting that we can flip the toggle after a while, and remove the warning
at that point, too.

This involves also refactoring clean_details() to return the results unwrapped.
For the time being the default behavior will remain the same as it was (wrapped),
but a deprecation warning will be raised.

I'm expecting that we can flip the toggle after a while, and remove the warning
at that point, too.
miio/vacuum.py Outdated
def clean_details(self, id_: int) -> List[CleaningDetails]:
def clean_details(self, id_: int, return_list=True) -> Union[
List[CleaningDetails],
Optional[CleaningDetails]]:

Choose a reason for hiding this comment

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

continuation line with same indent as next logical line

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 72.95% when pulling 9efc445 on refactor_clean_details into 3a98ecb on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 72.95% when pulling 9efc445 on refactor_clean_details into 3a98ecb on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 72.914% when pulling 6b792bc on refactor_clean_details into 3a98ecb on master.

@rytilahti rytilahti mentioned this pull request Oct 31, 2018
Copy link
Collaborator

@syssi syssi left a comment

Choose a reason for hiding this comment

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

LGTM.

@rytilahti rytilahti merged commit af65eb3 into master Oct 31, 2018
@rytilahti rytilahti deleted the refactor_clean_details branch November 17, 2018 01:46
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.

4 participants