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 a more helpful error message when info() fails with an empty payload #164

Merged
merged 1 commit into from
Jan 20, 2018
Merged
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
10 changes: 7 additions & 3 deletions miio/vacuum_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,14 @@ def map(vac: miio.Vacuum):
@pass_dev
def info(vac: miio.Vacuum):
"""Return device information."""
res = vac.info()
try:
res = vac.info()

click.echo("%s" % res)
_LOGGER.debug("Full response: %s", pf(res.raw))
click.echo("%s" % res)
_LOGGER.debug("Full response: %s", pf(res.raw))
except TypeError:
click.echo("Unable to fetch info, this can happen when the vacuum "
"is not connected to the Xiaomi cloud.")


@cli.command()
Expand Down