From 05be93313fafff4007072aea978c471051b1ee2b Mon Sep 17 00:00:00 2001 From: Teemu R Date: Sat, 6 Oct 2018 18:01:48 +0200 Subject: [PATCH] Fix click7 compatibility (#387) click7 changed the passed parameters for a resultcallback, this commit simply adds unused *args to the method signature to make it work on both click6.7 and click7. Fixes #386 --- miio/vacuum.py | 2 +- miio/vacuum_cli.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/miio/vacuum.py b/miio/vacuum.py index 734c10ebf..6a7e9eced 100644 --- a/miio/vacuum.py +++ b/miio/vacuum.py @@ -419,7 +419,7 @@ def callback(ctx, *args, id_file, **kwargs): @dg.resultcallback() @dg.device_pass - def cleanup(vac: Vacuum, **kwargs): + def cleanup(vac: Vacuum, *args, **kwargs): if vac.ip is None: # dummy Device for discovery, skip teardown return id_file = kwargs['id_file'] diff --git a/miio/vacuum_cli.py b/miio/vacuum_cli.py index 8bf375b2a..29f313a34 100644 --- a/miio/vacuum_cli.py +++ b/miio/vacuum_cli.py @@ -73,7 +73,7 @@ def cli(ctx, ip: str, token: str, debug: int, id_file: str): @cli.resultcallback() @pass_dev -def cleanup(vac: miio.Vacuum, **kwargs): +def cleanup(vac: miio.Vacuum, *args, **kwargs): if vac.ip is None: # dummy Device for discovery, skip teardown return id_file = kwargs['id_file']