FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Backoff after xor timeout and improve error reporting by bdraco · Pull Request #1424 · python-kasa/python-kasa · GitHub

Repository navigation

Backoff after xor timeout and improve error reporting - #1424

Merged
sdb9696 merged 5 commits into
masterfrom
imporve_timeout_error_reporting
Jan 6, 2025
Merged

sdb9696 merged 5 commits into
masterfrom
imporve_timeout_error_reporting

Conversation

bdraco commented Jan 5, 2025 •
edited
Loading

Copy link
Copy Markdown
Member

asyncio.TimeoutError doesn't provide a useful error string so we need to provide something better

>>> str(asyncio.TimeoutError())
''

related issue home-assistant/core#128677

codecov Bot commented Jan 5, 2025 •
edited
Loading

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.56%. Comparing base (1f45f42) to head (f9419c9).
Report is 73 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1424      +/-   ##
==========================================
+ Coverage   92.52%   92.56%   +0.04%     
==========================================
  Files         132      132              
  Lines        8251     8269      +18     
  Branches      848      851       +3     
==========================================
+ Hits         7634     7654      +20     
+ Misses        453      452       -1     
+ Partials      164      163       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

bdraco marked this pull request as draft January 5, 2025 23:36
rytilahti added this to the 0.9.1 milestone Jan 5, 2025
rytilahti added the bug Something isn't working label Jan 5, 2025
bdraco marked this pull request as ready for review January 5, 2025 23:59

sdb9696 commented Jan 6, 2025

Copy link
Copy Markdown
Contributor

I've tweaked this to raise TimeoutError instead of _RetryableError which will cause it to sleep in IotProtocol between retries. This is consistent with other transports and as this appears to happen intermittently every minute or so, so a back-off could let the device recover and prevent the coordinator failing then recovering (the device must be recovering at some point otherwise the log wouldn't be getting repeated error messages:

2025-01-03 23:46:44.957 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-03 23:47:42.811 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-03 23:48:33.820 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-03 23:49:32.896 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-03 23:50:30.952 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-03 23:51:21.836 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-03 23:51:58.406 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-03 23:52:56.163 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to connect to the device: 10.1.11.19:9999: 
2025-01-03 23:53:51.639 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-03 23:54:48.901 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-03 23:55:23.923 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-03 23:58:18.814 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-03 23:59:10.469 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-03 23:59:59.896 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-04 00:00:50.888 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-04 00:02:58.925 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-04 00:03:58.789 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-04 00:04:43.645 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.14 data: Unable to query the device 10.1.11.14:9999: 
2025-01-04 00:04:46.813 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-04 00:05:48.972 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-04 00:08:09.979 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 
2025-01-04 00:09:59.748 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 10.1.11.19 data: Unable to query the device 10.1.11.19:9999: 

sdb9696 changed the title Improve timeout error reporting Backoff after xor timeout and improve error reporting Jan 6, 2025
sdb9696 merged commit 7d508b5 into master Jan 6, 2025
sdb9696 deleted the imporve_timeout_error_reporting branch January 6, 2025 14:00
sdb9696 mentioned this pull request Jan 6, 2025
sdb9696 added a commit that referenced this pull request Jan 6, 2025
## [0.9.1](https://github.com/python-kasa/python-kasa/tree/0.9.1) (2025-01-06)

[Full Changelog](0.9.0...0.9.1)

**Release summary:**

- Support for hub-attached wall switches S210 and S220
- Support for older firmware on Tapo cameras
- Bugfixes and improvements

**Implemented enhancements:**

- Add support for Tapo hub-attached switch devices [\#1421](#1421) (@sdb9696)
- Use repr\(\) for enum values in Feature.\_\_repr\_\_ [\#1414](#1414) (@rytilahti)
- Update SslAesTransport for older firmware versions [\#1362](#1362) (@sdb9696)

**Fixed bugs:**

- T310 not detected with H200 Hub [\#1409](#1409)
- Backoff after xor timeout and improve error reporting [\#1424](#1424) (@bdraco)
- Fix incorrect obd src echo [\#1412](#1412) (@rytilahti)
- Handle smartcam partial list responses [\#1411](#1411) (@sdb9696)

**Added support for devices:**

- Add S220 fixture [\#1419](#1419) (@rytilahti)
- Add S210 fixture [\#1418](#1418) (@rytilahti)

**Documentation updates:**

- Improve exception messages on credential mismatches [\#1417](#1417) (@rytilahti)

**Project maintenance:**

- Add C210 2.0 1.3.11 fixture [\#1406](#1406) (@sdb9696)
- Add HS210\(US\) 3.0 1.0.10 IOT Fixture [\#1405](#1405) (@ZeliardM)
- Change smartcam detection features to category config [\#1402](#1402) (@sdb9696)
rytilahti pushed a commit to rytilahti/python-kasa that referenced this pull request Aug 31, 2025
rytilahti pushed a commit to rytilahti/python-kasa that referenced this pull request Aug 31, 2025
## [0.9.1](https://github.com/python-kasa/python-kasa/tree/0.9.1) (2025-01-06)

[Full Changelog](python-kasa/python-kasa@0.9.0...0.9.1)

**Release summary:**

- Support for hub-attached wall switches S210 and S220
- Support for older firmware on Tapo cameras
- Bugfixes and improvements

**Implemented enhancements:**

- Add support for Tapo hub-attached switch devices [\python-kasa#1421](python-kasa#1421) (@sdb9696)
- Use repr\(\) for enum values in Feature.\_\_repr\_\_ [\python-kasa#1414](python-kasa#1414) (@rytilahti)
- Update SslAesTransport for older firmware versions [\python-kasa#1362](python-kasa#1362) (@sdb9696)

**Fixed bugs:**

- T310 not detected with H200 Hub [\python-kasa#1409](python-kasa#1409)
- Backoff after xor timeout and improve error reporting [\python-kasa#1424](python-kasa#1424) (@bdraco)
- Fix incorrect obd src echo [\python-kasa#1412](python-kasa#1412) (@rytilahti)
- Handle smartcam partial list responses [\python-kasa#1411](python-kasa#1411) (@sdb9696)

**Added support for devices:**

- Add S220 fixture [\python-kasa#1419](python-kasa#1419) (@rytilahti)
- Add S210 fixture [\python-kasa#1418](python-kasa#1418) (@rytilahti)

**Documentation updates:**

- Improve exception messages on credential mismatches [\python-kasa#1417](python-kasa#1417) (@rytilahti)

**Project maintenance:**

- Add C210 2.0 1.3.11 fixture [\python-kasa#1406](python-kasa#1406) (@sdb9696)
- Add HS210\(US\) 3.0 1.0.10 IOT Fixture [\python-kasa#1405](python-kasa#1405) (@ZeliardM)
- Change smartcam detection features to category config [\python-kasa#1402](python-kasa#1402) (@sdb9696)
rytilahti pushed a commit to rytilahti/python-kasa that referenced this pull request Oct 26, 2025
rytilahti pushed a commit to rytilahti/python-kasa that referenced this pull request Oct 26, 2025
## [0.9.1](https://github.com/python-kasa/python-kasa/tree/0.9.1) (2025-01-06)

[Full Changelog](python-kasa/python-kasa@0.9.0...0.9.1)

**Release summary:**

- Support for hub-attached wall switches S210 and S220
- Support for older firmware on Tapo cameras
- Bugfixes and improvements

**Implemented enhancements:**

- Add support for Tapo hub-attached switch devices [\python-kasa#1421](python-kasa#1421) (@sdb9696)
- Use repr\(\) for enum values in Feature.\_\_repr\_\_ [\python-kasa#1414](python-kasa#1414) (@rytilahti)
- Update SslAesTransport for older firmware versions [\python-kasa#1362](python-kasa#1362) (@sdb9696)

**Fixed bugs:**

- T310 not detected with H200 Hub [\python-kasa#1409](python-kasa#1409)
- Backoff after xor timeout and improve error reporting [\python-kasa#1424](python-kasa#1424) (@bdraco)
- Fix incorrect obd src echo [\python-kasa#1412](python-kasa#1412) (@rytilahti)
- Handle smartcam partial list responses [\python-kasa#1411](python-kasa#1411) (@sdb9696)

**Added support for devices:**

- Add S220 fixture [\python-kasa#1419](python-kasa#1419) (@rytilahti)
- Add S210 fixture [\python-kasa#1418](python-kasa#1418) (@rytilahti)

**Documentation updates:**

- Improve exception messages on credential mismatches [\python-kasa#1417](python-kasa#1417) (@rytilahti)

**Project maintenance:**

- Add C210 2.0 1.3.11 fixture [\python-kasa#1406](python-kasa#1406) (@sdb9696)
- Add HS210\(US\) 3.0 1.0.10 IOT Fixture [\python-kasa#1405](python-kasa#1405) (@ZeliardM)
- Change smartcam detection features to category config [\python-kasa#1402](python-kasa#1402) (@sdb9696)
rytilahti pushed a commit to rytilahti/python-kasa that referenced this pull request Nov 10, 2025
rytilahti pushed a commit to rytilahti/python-kasa that referenced this pull request Nov 10, 2025
## [0.9.1](https://github.com/python-kasa/python-kasa/tree/0.9.1) (2025-01-06)

[Full Changelog](python-kasa/python-kasa@0.9.0...0.9.1)

**Release summary:**

- Support for hub-attached wall switches S210 and S220
- Support for older firmware on Tapo cameras
- Bugfixes and improvements

**Implemented enhancements:**

- Add support for Tapo hub-attached switch devices [\python-kasa#1421](python-kasa#1421) (@sdb9696)
- Use repr\(\) for enum values in Feature.\_\_repr\_\_ [\python-kasa#1414](python-kasa#1414) (@rytilahti)
- Update SslAesTransport for older firmware versions [\python-kasa#1362](python-kasa#1362) (@sdb9696)

**Fixed bugs:**

- T310 not detected with H200 Hub [\python-kasa#1409](python-kasa#1409)
- Backoff after xor timeout and improve error reporting [\python-kasa#1424](python-kasa#1424) (@bdraco)
- Fix incorrect obd src echo [\python-kasa#1412](python-kasa#1412) (@rytilahti)
- Handle smartcam partial list responses [\python-kasa#1411](python-kasa#1411) (@sdb9696)

**Added support for devices:**

- Add S220 fixture [\python-kasa#1419](python-kasa#1419) (@rytilahti)
- Add S210 fixture [\python-kasa#1418](python-kasa#1418) (@rytilahti)

**Documentation updates:**

- Improve exception messages on credential mismatches [\python-kasa#1417](python-kasa#1417) (@rytilahti)

**Project maintenance:**

- Add C210 2.0 1.3.11 fixture [\python-kasa#1406](python-kasa#1406) (@sdb9696)
- Add HS210\(US\) 3.0 1.0.10 IOT Fixture [\python-kasa#1405](python-kasa#1405) (@ZeliardM)
- Change smartcam detection features to category config [\python-kasa#1402](python-kasa#1402) (@sdb9696)
rytilahti pushed a commit to rytilahti/python-kasa that referenced this pull request Jul 5, 2026
rytilahti pushed a commit to rytilahti/python-kasa that referenced this pull request Jul 5, 2026
## [0.9.1](https://github.com/python-kasa/python-kasa/tree/0.9.1) (2025-01-06)

[Full Changelog](python-kasa/python-kasa@0.9.0...0.9.1)

**Release summary:**

- Support for hub-attached wall switches S210 and S220
- Support for older firmware on Tapo cameras
- Bugfixes and improvements

**Implemented enhancements:**

- Add support for Tapo hub-attached switch devices [\python-kasa#1421](python-kasa#1421) (@sdb9696)
- Use repr\(\) for enum values in Feature.\_\_repr\_\_ [\python-kasa#1414](python-kasa#1414) (@rytilahti)
- Update SslAesTransport for older firmware versions [\python-kasa#1362](python-kasa#1362) (@sdb9696)

**Fixed bugs:**

- T310 not detected with H200 Hub [\python-kasa#1409](python-kasa#1409)
- Backoff after xor timeout and improve error reporting [\python-kasa#1424](python-kasa#1424) (@bdraco)
- Fix incorrect obd src echo [\python-kasa#1412](python-kasa#1412) (@rytilahti)
- Handle smartcam partial list responses [\python-kasa#1411](python-kasa#1411) (@sdb9696)

**Added support for devices:**

- Add S220 fixture [\python-kasa#1419](python-kasa#1419) (@rytilahti)
- Add S210 fixture [\python-kasa#1418](python-kasa#1418) (@rytilahti)

**Documentation updates:**

- Improve exception messages on credential mismatches [\python-kasa#1417](python-kasa#1417) (@rytilahti)

**Project maintenance:**

- Add C210 2.0 1.3.11 fixture [\python-kasa#1406](python-kasa#1406) (@sdb9696)
- Add HS210\(US\) 3.0 1.0.10 IOT Fixture [\python-kasa#1405](python-kasa#1405) (@ZeliardM)
- Change smartcam detection features to category config [\python-kasa#1402](python-kasa#1402) (@sdb9696)
pillarsdotnet pushed a commit to pillarsdotnet/python-kasa that referenced this pull request Oct 22, 2026
pillarsdotnet pushed a commit to pillarsdotnet/python-kasa that referenced this pull request Oct 22, 2026
## [0.9.1](https://github.com/python-kasa/python-kasa/tree/0.9.1) (2025-01-06)

[Full Changelog](python-kasa/python-kasa@0.9.0...0.9.1)

**Release summary:**

- Support for hub-attached wall switches S210 and S220
- Support for older firmware on Tapo cameras
- Bugfixes and improvements

**Implemented enhancements:**

- Add support for Tapo hub-attached switch devices [\python-kasa#1421](python-kasa#1421) (@sdb9696)
- Use repr\(\) for enum values in Feature.\_\_repr\_\_ [\python-kasa#1414](python-kasa#1414) (@rytilahti)
- Update SslAesTransport for older firmware versions [\python-kasa#1362](python-kasa#1362) (@sdb9696)

**Fixed bugs:**

- T310 not detected with H200 Hub [\python-kasa#1409](python-kasa#1409)
- Backoff after xor timeout and improve error reporting [\python-kasa#1424](python-kasa#1424) (@bdraco)
- Fix incorrect obd src echo [\python-kasa#1412](python-kasa#1412) (@rytilahti)
- Handle smartcam partial list responses [\python-kasa#1411](python-kasa#1411) (@sdb9696)

**Added support for devices:**

- Add S220 fixture [\python-kasa#1419](python-kasa#1419) (@rytilahti)
- Add S210 fixture [\python-kasa#1418](python-kasa#1418) (@rytilahti)

**Documentation updates:**

- Improve exception messages on credential mismatches [\python-kasa#1417](python-kasa#1417) (@rytilahti)

**Project maintenance:**

- Add C210 2.0 1.3.11 fixture [\python-kasa#1406](python-kasa#1406) (@sdb9696)
- Add HS210\(US\) 3.0 1.0.10 IOT Fixture [\python-kasa#1405](python-kasa#1405) (@ZeliardM)
- Change smartcam detection features to category config [\python-kasa#1402](python-kasa#1402) (@sdb9696)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL