This commit is contained in:
J. Nick Koston 2023-11-19 10:58:30 -06:00
parent 541cd531f8
commit 1492e14077
No known key found for this signature in database

View File

@ -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(