homebridge-kasa-python 3.0.0-beta.7 → 3.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/python/kasaApi.py +5 -1
- package/package.json +1 -1
package/dist/python/kasaApi.py
CHANGED
|
@@ -347,7 +347,11 @@ async def perform_device_action(
|
|
|
347
347
|
child_num: Optional[int] = None,
|
|
348
348
|
) -> dict[str, Any]:
|
|
349
349
|
try:
|
|
350
|
-
|
|
350
|
+
if child_num is not None and device.children:
|
|
351
|
+
sorted_children = sorted(device.children, key=lambda c: _extract_child_suffix_index(c.device_id))
|
|
352
|
+
target = sorted_children[child_num]
|
|
353
|
+
else:
|
|
354
|
+
target = device
|
|
351
355
|
log(f"Performing action={action} on feature={feature}", alias=target.alias)
|
|
352
356
|
light = target.modules.get(Module.Light)
|
|
353
357
|
fan = target.modules.get(Module.Fan)
|
package/package.json
CHANGED