Fix type hinting issue with call to click.Choice (#387)

* Fix type hinting issue with call to click.Choice which takes a Sequence not dictionary. Convert TYPE_TO_CLASS keys to a list to pass in.

* Update kasa/cli.py

Co-authored-by: Teemu R. <tpr@iki.fi>

Co-authored-by: Jules Davis <jules@focalpointvr.com>
Co-authored-by: Teemu R. <tpr@iki.fi>
This commit is contained in:
Julian Davis 2022-10-27 16:40:24 +01:00 committed by GitHub
parent f32f7f3925
commit 1ac6c66277
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,7 +57,7 @@ pass_dev = click.make_pass_decorator(SmartDevice)
"--type", "--type",
envvar="KASA_TYPE", envvar="KASA_TYPE",
default=None, default=None,
type=click.Choice(TYPE_TO_CLASS, case_sensitive=False), type=click.Choice(list(TYPE_TO_CLASS), case_sensitive=False),
) )
@click.version_option(package_name="python-kasa") @click.version_option(package_name="python-kasa")
@click.pass_context @click.pass_context