Skip to content

Commit

Permalink
Fix click7 compatibility
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rytilahti committed Oct 6, 2018
1 parent c2b213c commit 82a1236
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion miio/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
2 changes: 1 addition & 1 deletion miio/vacuum_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit 82a1236

Please sign in to comment.