def _set_awb_mode(self, value):
    self._check_camera_open()
    try:
        mp = self._camera.control.params[mmal.MMAL_PARAMETER_AWB_MODE]
        mp.value = self.AWB_MODES[value]
    except KeyError:
        raise PiCameraValueError(('Invalid auto-white-balance mode: %s' % value))
    self._camera.control.params[mmal.MMAL_PARAMETER_AWB_MODE] = mp
def _set_awb_mode(self, value):
    self._check_camera_open()
    try:
        mp = self._camera.control.params[mmal.MMAL_PARAMETER_AWB_MODE]
        mp.value = self.AWB_MODES[value]
    except KeyError:
        raise PiCameraValueError(('Invalid auto-white-balance mode: %s' % value))
    self._camera.control.params[mmal.MMAL_PARAMETER_AWB_MODE] = mp