diff --git a/kasa/tests/test_cli.py b/kasa/tests/test_cli.py index 009632d7..fd76d933 100644 --- a/kasa/tests/test_cli.py +++ b/kasa/tests/test_cli.py @@ -7,7 +7,6 @@ from asyncclick.testing import CliRunner from kasa import SmartDevice, TPLinkSmartHomeProtocol from kasa.cli import ( - TYPE_TO_CLASS, alias, brightness, cli, @@ -17,6 +16,8 @@ from kasa.cli import ( sysinfo, toggle, ) +from kasa.device_factory import DEVICE_TYPE_TO_CLASS +from kasa.device_type import DeviceType from kasa.discover import Discover from .conftest import handle_turn_on, turn_on @@ -154,14 +155,9 @@ async def test_credentials(discovery_data: dict, mocker): ) mocker.patch("kasa.cli.state", new=_state) - - # Get the type string parameter from the discovery_info - for cli_device_type in { # noqa: B007 - i - for i in TYPE_TO_CLASS - if TYPE_TO_CLASS[i] == Discover._get_device_class(discovery_data) - }: - break + cli_device_type = Discover._get_device_class(discovery_data)( + "any" + ).device_type.value runner = CliRunner() res = await runner.invoke(