From 511e342e5d3d5c3ae3c18d8fef7f922bf4c1f43c Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Thu, 12 May 2022 15:33:07 -0400 Subject: [PATCH] Add a custom error for code "0110" Resolves https://github.com/sampsyo/hass-smartthinq/issues/109, which reports this interpretation of this error code. --- wideq/core.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wideq/core.py b/wideq/core.py index e169f11..def71e6 100644 --- a/wideq/core.py +++ b/wideq/core.py @@ -159,6 +159,12 @@ class InvalidRequestError(APIError): """The server rejected a request as invalid.""" +class AgreementError(APIError): + """The user needs to manually log in again to agree to new terms and + conditions. + """ + + class MonitorError(APIError): """Monitoring a device failed, possibly because the monitoring session failed and needs to be restarted. @@ -180,6 +186,7 @@ def __init__(self, data): "0102": NotLoggedInError, "0106": NotConnectedError, "0100": FailedRequestError, + "0110": AgreementError, 9000: InvalidRequestError, # Surprisingly, an integer (not a string). 9003: NotLoggedInError, # Session Creation FailureError }