Handle unknown error codes gracefully (#1016)

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 https://github.com/home-assistant/core/issues/118446
This commit is contained in:
Teemu R
2024-06-27 16:58:45 +02:00
committed by GitHub
parent 0a85243199
commit cf24a94526
5 changed files with 65 additions and 2 deletions

View File

@@ -119,6 +119,9 @@ class SmartErrorCode(IntEnum):
DST_ERROR = -2301
DST_SAVE_ERROR = -2302
# Library internal for unknown error codes
INTERNAL_UNKNOWN_ERROR = -100_000
SMART_RETRYABLE_ERRORS = [
SmartErrorCode.TRANSPORT_NOT_AVAILABLE_ERROR,