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.
@@ -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
- target = device.children[child_num] if child_num is not None else device
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Homebridge Kasa Python",
3
3
  "name": "homebridge-kasa-python",
4
- "version": "3.0.0-beta.7",
4
+ "version": "3.0.0-beta.8",
5
5
  "description": "Plugin that uses Python-Kasa API to communicate with Kasa Devices.",
6
6
  "license": "MIT",
7
7
  "type": "module",