Skip to content

Handle unknown error codes gracefully #1016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 27, 2024
Merged

Conversation

rytilahti
Copy link
Member

Makes unknown error codes to be reported through KasaException which may be recoverable in some cases (i.e., a single command failing in the multi request).

Related to home-assistant/core#118446

Copy link

codecov bot commented Jun 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.22%. Comparing base (0a85243) to head (00952a8).
Report is 79 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1016      +/-   ##
==========================================
+ Coverage   91.20%   91.22%   +0.01%     
==========================================
  Files          84       84              
  Lines        5627     5638      +11     
  Branches     1374     1374              
==========================================
+ Hits         5132     5143      +11     
  Misses        384      384              
  Partials      111      111              

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

Copy link
Collaborator

@sdb9696 sdb9696 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but this should also be implemented in aestransport

@rytilahti
Copy link
Member Author

Looks good but this should also be implemented in aestransport

Ohh, I thought that this would be only above the transport layer, but I see that it also has some error handling. I'll look into that, thanks for the review!

@rytilahti
Copy link
Member Author

Added for aestransport & renamed the error to indicate that it's our internal error.

Copy link
Collaborator

@sdb9696 sdb9696 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rytilahti rytilahti added this to the 0.7.0.2 milestone Jun 26, 2024
@rytilahti rytilahti merged commit cf24a94 into master Jun 27, 2024
25 checks passed
@rytilahti rytilahti deleted the fix/handle_unknown_error_codes branch June 27, 2024 14:58
@sdb9696 sdb9696 mentioned this pull request Jul 1, 2024
sdb9696 added a commit that referenced this pull request Jul 1, 2024
## [0.7.0.2](https://github.com/python-kasa/python-kasa/tree/0.7.0.2) (2024-07-01)

[Full Changelog](0.7.0.1...0.7.0.2)

This patch release fixes some minor issues found out during testing against all new homeassistant platforms.

**Fixed bugs:**

- Disable multi-request on unknown errors [\#1027](#1027) (@sdb9696)
- Disable multi requests on json decode error during multi-request [\#1025](#1025) (@sdb9696)
- Fix changing brightness when effect is active [\#1019](#1019) (@rytilahti)
- Update light transition module to work with child devices [\#1017](#1017) (@sdb9696)
- Handle unknown error codes gracefully [\#1016](#1016) (@rytilahti)

**Project maintenance:**

- Make parent attribute on device consistent across iot and smart [\#1023](#1023) (@sdb9696)
- Cache SmartErrorCode creation [\#1022](#1022) (@bdraco)
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.

2 participants