Add https parameter to device class factory (#1184)

`SMART.TAPOHUB` resolves to different device classes based on the https value
This commit is contained in:
Steven B.
2024-10-22 18:09:35 +01:00
committed by GitHub
parent 3c865b5fb6
commit 048c84d72c
8 changed files with 73 additions and 23 deletions

View File

@@ -658,12 +658,14 @@ async def test_discovery_decryption():
async def test_discover_try_connect_all(discovery_mock, mocker):
"""Test that device update is called on main."""
if "result" in discovery_mock.discovery_data:
dev_class = get_device_class_from_family(discovery_mock.device_type)
dev_class = get_device_class_from_family(
discovery_mock.device_type, https=discovery_mock.https
)
cparams = DeviceConnectionParameters.from_values(
discovery_mock.device_type,
discovery_mock.encrypt_type,
discovery_mock.login_version,
False,
discovery_mock.https,
)
protocol = get_protocol(
DeviceConfig(discovery_mock.ip, connection_type=cparams)