| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #1792 +/- ##
==========================================
+ Coverage 93.41% 93.45% +0.04%
==========================================
Files 159 159
Lines 10113 10116 +3
Branches 1043 1044 +1
==========================================
+ Hits 9447 9454 +7
+ Misses 472 470 -2
+ Partials 194 192 -2 ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
|
Confirming this on HS110(UK) hw 4.1, fw 1.1.1 Build 201203 Rel.135822, the same model and firmware as #1788. I'm on HA 2026.10.1 with python-kasa 0.11.0.1. Discovery works, but the first update() times out three times on port 9999 and the config flow fails. An HS100(UK) hw 2.1 on fw 1.5.10 on the same network works normally. I sent raw XOR requests directly to the plug, opening a new connection for each, with a 6 s timeout:
This firmware matches @ewalker101's finding: it hangs whenever an unsupported module comes directly after system. HomeKit sent on its own returns the unsupported error cleanly, and the rest of the batch works without it, so the #1792 approach should work for this device. Because foo.bar after system also hangs, it may be worth covering that general case too, so a future module doesn't reintroduce the bug. I haven't run the #1792 branch yet. I'm happy to test it if that helps. |
Sorry, something went wrong.
|
Confirmed the production change in this PR (ee5061e37ccad6bd95cd2cacaa812a9db773817f) restores two EP10(US), hardware 1.0, firmware 1.0.2 Build 200915 Rel.085940 plugs, both in an isolated macOS/Python 3.14 test and in Home Assistant OS 18.3 / Core 2026.10.1.
The temporary loader checks the exact library version and original/replacement source fingerprints, then constructs the replacement with FunctionType(candidate.__code__, original.__globals__, ...) and assigns it to IotDevice._modular_update. It uses the PR's unchanged method, retaining HomeKit queries as separate requests; it does not use the workaround that disables the HomeKit module. No installed library files, device firmware, cloud pairing, or firewall settings were changed, and no HA rollback was needed. Full test results, installation method, guards, and limitations. This confirms the PR's production change via a locally constructed runtime backport, rather than installing/testing the entire candidate package. I did not run the full upstream suite or test a HomeKit-capable device. This is immediate post-restart verification, not a long-term soak test. |
Sorry, something went wrong.
|
For review: HS110(UK) hw 4.1 / fw 1.1.1 Build 201203 Rel.135822 is now confirmed too. That's the beta-firmware model from #1788, and the one gap #1791 called out. @AlecRust ran ee5061e on all three of their plugs: updates work, including after reconnecting, and energy readings are intact (comment on #1788). So this commit now has real-hardware passes on EP10, HS103, KP115 and HS110(UK). KP100 (#1799) and HS200 (#1803) show the same failure signature but haven't been run against it yet. |
Sorry, something went wrong.
|
Another confirmation matching #1803:
The switch stopped initializing after the upgrade. Power cycling the switch and restarting HA did not help. The Kasa app still controlled it locally with internet access blocked. HA debug logs showed standalone system.get_sysinfo succeeding in about 0.11 seconds. The combined initialization query, with smartlife.iot.homekit.setup_info_get immediately after system, repeatedly timed out waiting for the response header. A version-guarded custom component making HomeKit.query() return {} restored initialization and normal switching from HA after a restart. To clarify, this validates the probe-suppression workaround, not this PR’s separate-request implementation. Thanks for working on the long term fix! |
Sorry, something went wrong.
|
Tested PR #1792 against TP-Link KP100(US), hardware v3.0, firmware 1.0.1 Build 200831 Rel.142128. Results: PR #1792 (ee5061e): Successfully retrieves device state. This confirms the proposed fix resolves the regression on KP100(US) hardware v3.0. Thank you for working on this! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Send the IoT HomeKit query in its own request. Some legacy firmware times out when an unsupported smartlife.iot.homekit.setup_info_get query follows another module in a batch, preventing the entire device update from completing.
Fixes: #1791
Fixes: #1788
I've tested this fix on devices EP10, HS103 and KP115. A closely matching downstream report is home-assistant/core#185859.
Root cause
On the same devices and network path, python-kasa 0.10.2 completes initial and subsequent updates, while 0.11.0.1 times out. The probe was introduced in #1566.
This minimal request times out while waiting for the response header:
{"system":{"get_sysinfo":{}},"smartlife.iot.homekit":{"setup_info_get":{}}}Reversing the two module keys succeeds. Sending HomeKit alone also succeeds and returns:
{"smartlife.iot.homekit":{"err_code":-1,"err_msg":"module not support"}}This ordering behavior was reproduced on EP10(US) hardware 1.0 / firmware 1.0.2, HS103(US) hardware 5.0 / firmware 1.0.3, and KP115(US) hardware 1.0 / firmware 1.0.7. Full firmware build identifiers are in #1791.
Implementation
Keep HomeKit out of the normal modular-update batch and merge its response through the existing update path. Unsupported responses are cached by the existing module support detection, so subsequent updates omit the query. Supported HomeKit remains available. Genuine communication failures and cancellation still propagate.
The production change is six lines and avoids relying on JSON key ordering or model/firmware lists. Unsupported devices incur one additional request during initialization; supported devices query HomeKit separately during updates.
Validation