diff --git a/src/aiovantage/command_client/commands.py b/src/aiovantage/command_client/commands.py index 1cfa126..21ab8c5 100644 --- a/src/aiovantage/command_client/commands.py +++ b/src/aiovantage/command_client/commands.py @@ -15,6 +15,7 @@ InvalidObjectError, LoginFailedError, LoginRequiredError, + ObjectOfflineError, ) from .utils import encode_params, tokenize_response @@ -187,6 +188,8 @@ def _parse_command_error(self, message: str) -> CommandError: exc: CommandError if error_code == 7: exc = InvalidObjectError(error_message) + elif error_code == 20: + exc = ObjectOfflineError(error_message) elif error_code == 21: exc = LoginRequiredError(error_message) elif error_code == 23: diff --git a/src/aiovantage/errors.py b/src/aiovantage/errors.py index cd8a9dd..2135893 100644 --- a/src/aiovantage/errors.py +++ b/src/aiovantage/errors.py @@ -33,3 +33,7 @@ class LoginRequiredError(CommandError): class InvalidObjectError(CommandError): """The requested object ID is invalid.""" + + +class ObjectOfflineError(CommandError): + """The requested object is offline."""