diff --git a/miio/exceptions.py b/miio/exceptions.py index be9d8125f..7f54c6fe4 100644 --- a/miio/exceptions.py +++ b/miio/exceptions.py @@ -5,7 +5,9 @@ class DeviceException(Exception): class DeviceError(DeviceException): """Exception communicating an error delivered by the target device.""" - pass + def __init__(self, error): + self.code = error.get('code') + self.message = error.get('message') class RecoverableError(DeviceError):