homebridge-kasa-python 3.0.0-beta.6 → 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/README.md CHANGED
@@ -11,15 +11,15 @@
11
11
  </span>
12
12
 
13
13
  <p align="center">
14
- <a href="https://github.com/ZeliardM/homebridge-kasa-python/blob/latest/LICENSE"><img src="https://badgen.net/npm/license/homebridge-kasa-python" alt="mit license"></a>
15
- <a href="https://www.npmjs.com/package/homebridge-kasa-python/v/latest"><img src="https://badgen.net/npm/v/homebridge-kasa-python/latest?label=npm@latest" alt="latest npm version"></a>
16
- <a href="https://pypi.org/project/python-kasa/"><img src="https://badgen.net/badge/Python@latest/3.11,%203.12,%203.13" alt="latest PyPI pyversions"></a>
17
- <a href="https://www.npmjs.com/package/homebridge-kasa-python/v/beta"><img src="https://badgen.net/npm/v/homebridge-kasa-python/beta?label=npm@beta&color=cyan" alt="beta npm version"></a>
18
- <a href="https://pypi.org/project/python-kasa/"><img src="https://badgen.net/badge/Python@beta/3.11,%203.12,%203.13?color=cyan" alt="beta PyPI pyversions"></a>
19
- <a href="https://www.npmjs.com/package/homebridge-kasa-python/v/latest"><img src="https://badgen.net/npm/dt/homebridge-kasa-python" alt="npm downloads total"></a>
20
- <a href="https://www.paypal.me/ZeliardM/USD/"><img src="https://badgen.net/badge/donate/paypal?color=orange" alt="donate"></a>
21
- <a href="https://github.com/sponsors/ZeliardM"><img src="https://badgen.net/badge/donate/github?color=orange" alt="donate"></a>
22
- <a href="https://github.com/homebridge/homebridge/wiki/Verified-Plugins"><img src="https://badgen.net/badge/homebridge/verified?color=purple" alt="homebridge verified"></a>
14
+ <a href="https://github.com/ZeliardM/homebridge-kasa-python/blob/latest/LICENSE"><img src="https://img.shields.io/npm/l/homebridge-kasa-python?color=yellow" alt="mit license"></a>
15
+ <a href="https://www.npmjs.com/package/homebridge-kasa-python/v/latest"><img src="https://img.shields.io/npm/v/homebridge-kasa-python/latest?label=npm%40latest&color=blue" alt="latest npm version"></a>
16
+ <a href="https://pypi.org/project/python-kasa/"><img src="https://img.shields.io/badge/Python%40latest-3.11%2C%203.12%2C%203.13-blue" alt="latest PyPI pyversions"></a>
17
+ <a href="https://www.npmjs.com/package/homebridge-kasa-python/v/beta"><img src="https://img.shields.io/npm/v/homebridge-kasa-python/beta?label=npm%40beta&color=red" alt="beta npm version"></a>
18
+ <a href="https://pypi.org/project/python-kasa/"><img src="https://img.shields.io/badge/Python%40latest-3.11%2C%203.12%2C%203.13-red" alt="beta PyPI pyversions"></a>
19
+ <a href="https://www.npmjs.com/package/homebridge-kasa-python/v/latest"><img src="https://img.shields.io/npm/dt/homebridge-kasa-python?color=brightgreen" alt="npm downloads total"></a>
20
+ <a href="https://www.paypal.me/ZeliardM/USD/"><img src="https://img.shields.io/badge/donate-paypal-orange" alt="donate paypal"></a>
21
+ <a href="https://github.com/sponsors/ZeliardM"><img src="https://img.shields.io/badge/donate-github-orange" alt="donate github"></a>
22
+ <a href="https://github.com/homebridge/homebridge/wiki/Verified-Plugins"><img src="https://img.shields.io/badge/homebridge-verified-blueviolet" alt="homebridge verified"></a>
23
23
  </p>
24
24
 
25
25
  <div align="center">
@@ -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.6",
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",