Pass raw components to SmartChildDevice init (#1363)

Clean up and consolidate the processing of raw component query responses and simplify the code paths for creating smartcam child devices when supported.
This commit is contained in:
Steven B.
2024-12-11 14:38:38 +00:00
committed by GitHub
parent 8cb5c2e180
commit f8a46f74cd
5 changed files with 51 additions and 39 deletions

View File

@@ -86,7 +86,11 @@ async def test_device_class_ctors(device_class_name_obj):
if issubclass(klass, SmartChildDevice):
parent = SmartDevice(host, config=config)
dev = klass(
parent, {"dummy": "info", "device_id": "dummy"}, {"dummy": "components"}
parent,
{"dummy": "info", "device_id": "dummy"},
{
"component_list": [{"id": "device", "ver_code": 1}],
},
)
else:
dev = klass(host, config=config)
@@ -106,7 +110,11 @@ async def test_device_class_repr(device_class_name_obj):
if issubclass(klass, SmartChildDevice):
parent = SmartDevice(host, config=config)
dev = klass(
parent, {"dummy": "info", "device_id": "dummy"}, {"dummy": "components"}
parent,
{"dummy": "info", "device_id": "dummy"},
{
"component_list": [{"id": "device", "ver_code": 1}],
},
)
else:
dev = klass(host, config=config)