diff --git a/miio/vacuum_cli.py b/miio/vacuum_cli.py index 8d64fc024..8980f7d6c 100644 --- a/miio/vacuum_cli.py +++ b/miio/vacuum_cli.py @@ -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()