Include component_nego with child fixtures (#858)

This commit is contained in:
Steven B 2024-04-22 18:17:11 +01:00 committed by GitHub
parent 0ab7436eef
commit 03a0ef3cc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -500,6 +500,14 @@ async def get_smart_test_calls(device: SmartDevice):
# Child component calls
for child_device_id, child_components in child_device_components.items():
test_calls.append(
SmartCall(
module="component_nego",
request=SmartRequest("component_nego"),
should_succeed=True,
child_device_id=child_device_id,
)
)
for component_id, ver_code in child_components.items():
if (requests := get_component_requests(component_id, ver_code)) is not None:
component_test_calls = [
@ -621,7 +629,8 @@ async def get_smart_fixtures(device: SmartDevice, batch_size: int):
response["get_device_info"]["device_id"] = scrubbed
# If the child is a different model to the parent create a seperate fixture
if (
"get_device_info" in response
"component_nego" in response
and "get_device_info" in response
and (child_model := response["get_device_info"].get("model"))
and child_model != final["get_device_info"]["model"]
):