def _wrap(self, *args, **kwargs):
    import yeelight
    try:
        _LOGGER.debug('Calling %s with %s %s', func, args, kwargs)
        return func(self, *args, **kwargs)
    except yeelight.BulbException as ex:
        _LOGGER.error('Error when calling %s: %s', func, ex)
def _wrap(self, *args, **kwargs):
    import yeelight
    try:
        _LOGGER.debug('Calling %s with %s %s', func, args, kwargs)
        return func(self, *args, **kwargs)
    except yeelight.BulbException as ex:
        _LOGGER.error('Error when calling %s: %s', func, ex)