Exceptions

A HueError is raised whenever an API request fails. As it contains the error code, high-level functions can use this to distinguish expected from unexpected errors. For example, Light.darker() will receive a HueError if the light is already off, which can be safely ignored and is hence swallowed.

class huegely.exceptions.HueError(message, error_code=None, device=None, *args)[source]

Exception for hue api errors, containing the error code to allow more specific error handling.

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.