def _set_flash_mode(self, value):
    self._check_camera_open()
    try:
        mp = self._camera.control.params[mmal.MMAL_PARAMETER_FLASH]
        mp.value = self.FLASH_MODES[value]
    except KeyError:
        raise PiCameraValueError(('Invalid flash mode: %s' % value))
    self._camera.control.params[mmal.MMAL_PARAMETER_FLASH] = mp
def _set_flash_mode(self, value):
    self._check_camera_open()
    try:
        mp = self._camera.control.params[mmal.MMAL_PARAMETER_FLASH]
        mp.value = self.FLASH_MODES[value]
    except KeyError:
        raise PiCameraValueError(('Invalid flash mode: %s' % value))
    self._camera.control.params[mmal.MMAL_PARAMETER_FLASH] = mp