mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-12 10:28:01 +00:00
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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user