Enable motion detection for a camera.

    :param blink: Blink instance.
    :param network: Sync module network id.
    :param camera_id: Camera ID of camera to enable.
17251
def request_motion_detection_enable(blink, network, camera_id):
    
    url = "{}/network/{}/camera/{}/enable".format(blink.urls.base_url,
                                                  network,
                                                  camera_id)
    return http_post(blink, url)
1114610
def start(self):
        
        self._sensor = cv2.VideoCapture(self._device_id)
        if not self._sensor.isOpened():
            raise Exception("Unable to open OpenCVCameraSensor for id {0}".format(self._device_id))
        self.flush()
51361
def watch(cams, path=None, delay=10):
    """"""
    while True:
        for c in cams:
            c.snap(path)
        time.sleep(delay)
729186
private void requestCameraPermission() {
        Log.w("BARCODE-SCANNER", "Camera permission is not granted. Requesting permission");

        final String[] permissions = new String[]{Manifest.permission.CAMERA};

        if (!shouldShowRequestPermissionRationale(Manifest.permission.CAMERA)) {
            requestPermissions(permissions, RC_HANDLE_CAMERA_PERM);
            return;
        }

        Snackbar.make(mGraphicOverlay, R.string.permission_camera_rationale, Snackbar.LENGTH_INDEFINITE)
                .setAction(R.string.ok, new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        requestPermissions(permissions, RC_HANDLE_CAMERA_PERM);
                    }
                })
                .show();


        /*
        new AlertDialog.Builder(getContext())
                .setTitle(R.string.perm_required)
                .setMessage(R.string.permission_camera_rationale)
                .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        //dialogInterface.dismiss();
                        requestPermissions(permissions, RC_HANDLE_CAMERA_PERM);
                    }
                })
                .setCancelable(false)
                .show();*/
    }
752749
def motion_sensor(self, enabled):
        """"""
        if enabled is True:
            value = CONST.SETTINGS_MOTION_POLICY_ON
        elif enabled is False:
            value = CONST.SETTINGS_MOTION_POLICY_OFF
        else:
            raise SkybellException(ERROR.INVALID_SETTING_VALUE,
                                   (CONST.SETTINGS_MOTION_POLICY, enabled))

        self._set_setting({CONST.SETTINGS_MOTION_POLICY: value})
116990
public boolean enable(Jid pushJid, String node)
            throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        return enable(pushJid, node, null);
    }
968182
def request_syncmodule(blink, network):
    
    url = "{}/network/{}/syncmodules".format(blink.urls.base_url, network)
    return http_get(blink, url)
1359666
def start_watching(self):
        
        if not self.is_sync:
            return

        self._stop = False
        while not self._stop:
            self.reactor.doIteration(0)
503467
def personSeenByCamera(self, name, home=None, camera=None):
        
        try:
            cam_id = self.cameraByName(camera=camera, home=home)['id']
        except TypeError:
            logger.warning("personSeenByCamera: Camera name or home is unknown")
            return False
        #Check in the last event is someone known has been seen
        if self.lastEvent[cam_id]['type'] == 'person':
            person_id = self.lastEvent[cam_id]['person_id']
            if 'pseudo' in self.persons[person_id]:
                if self.persons[person_id]['pseudo'] == name:
                    return True
        return False
30458
def blink1(switch_off=True, gamma=None, white_point=None):
    
    b1 = Blink1(gamma=gamma, white_point=white_point)
    yield b1
    if switch_off:
        b1.off()
    b1.close()
1044054
def motionDetected(self, home=None, camera=None):
        
        try:
            cam_id = self.cameraByName(camera=camera, home=home)['id']
        except TypeError:
            logger.warning("personSeenByCamera: Camera name or home is unknown")
            return False
        if self.lastEvent[cam_id]['type'] == 'movement':
            return True
        return False
688498
async def move_camera(self, position: Union[Unit, Point2, Point3]):
        
        assert isinstance(position, (Unit, Point2, Point3))
        if isinstance(position, Unit):
            position = position.position
        await self._execute(
            action=sc_pb.RequestAction(
                actions=[
                    sc_pb.Action(
                        action_raw=raw_pb.ActionRaw(
                            camera_move=raw_pb.ActionRawCameraMove(
                                center_world_space=common_pb.Point(x=position.x, y=position.y)
                            )
                        )
                    )
                ]
            )
        )
1290503
def begin(self):
        
        # Assert CS pin low for a second for PN532 to be ready.
        self._gpio.set_low(self._cs)
        time.sleep(1.0)
        # Call GetFirmwareVersion to sync up with the PN532.  This might not be
        # required but is done in the Arduino library and kept for consistency.
        self.get_firmware_version()
        self._gpio.set_high(self._cs)
742368
def request_video_count(blink):
    """"""
    url = "{}/api/v2/videos/count".format(blink.urls.base_url)
    return http_get(blink, url)
940692
def request_cameras(blink, network):
    
    url = "{}/network/{}/cameras".format(blink.urls.base_url, network)
    return http_get(blink, url)
484168
public void setLedBlinking(final boolean LED_BLINKING) {
        ledBlinking = LED_BLINKING;
        if (LED_BLINKING) {
            LED_BLINKING_TIMER.start();
        } else {
            setCurrentLedImage(getLedImageOff());
            LED_BLINKING_TIMER.stop();
        }
    }
365334
def request_sync_events(blink, network):
    
    url = "{}/events/network/{}".format(blink.urls.base_url, network)
    return http_get(blink, url)