Exemplo n.º 1
0
    def __init__(
        self,
        config_entry_id: str,
        username: str,
        password: str,
        camera: dict[str, Any],
        client: MotionEyeClient,
        coordinator: DataUpdateCoordinator[dict[str, Any] | None],
    ) -> None:
        """Initialize a MJPEG camera."""
        self._surveillance_username = username
        self._surveillance_password = password
        self._client = client
        self._camera_id = camera[KEY_ID]
        self._device_identifier = get_motioneye_device_identifier(
            config_entry_id, self._camera_id)
        self._unique_id = get_motioneye_entity_unique_id(
            config_entry_id, self._camera_id, TYPE_MOTIONEYE_MJPEG_CAMERA)
        self._motion_detection_enabled: bool = camera.get(
            KEY_MOTION_DETECTION, False)
        self._available = self._is_acceptable_streaming_camera(camera)

        # motionEye cameras are always streaming or unavailable.
        self.is_streaming = True

        MjpegCamera.__init__(
            self,
            {
                CONF_VERIFY_SSL: False,
                **self._get_mjpeg_camera_properties_for_camera(camera),
            },
        )
        CoordinatorEntity.__init__(self, coordinator)
Exemplo n.º 2
0
    def __init__(
        self,
        config_entry_id: str,
        username: str,
        password: str,
        camera: dict[str, Any],
        client: MotionEyeClient,
        coordinator: DataUpdateCoordinator,
        options: MappingProxyType[str, str],
    ) -> None:
        """Initialize a MJPEG camera."""
        self._surveillance_username = username
        self._surveillance_password = password
        self._motion_detection_enabled: bool = camera.get(KEY_MOTION_DETECTION, False)

        # motionEye cameras are always streaming or unavailable.
        self.is_streaming = True

        MotionEyeEntity.__init__(
            self,
            config_entry_id,
            TYPE_MOTIONEYE_MJPEG_CAMERA,
            camera,
            client,
            coordinator,
            options,
        )
        MjpegCamera.__init__(
            self,
            {
                CONF_VERIFY_SSL: False,
                **self._get_mjpeg_camera_properties_for_camera(camera),
            },
        )
Exemplo n.º 3
0
    def __init__(self, device):
        """Initialize Axis Communications camera component."""
        AxisEntityBase.__init__(self, device)

        config = {
            CONF_NAME: device.name,
            CONF_USERNAME: device.username,
            CONF_PASSWORD: device.password,
            CONF_MJPEG_URL: self.mjpeg_source,
            CONF_STILL_IMAGE_URL: self.image_source,
            CONF_AUTHENTICATION: HTTP_DIGEST_AUTHENTICATION,
        }
        MjpegCamera.__init__(self, config)
Exemplo n.º 4
0
 def __init__(self, config, device):
     """Initialize Axis Communications camera component."""
     AxisEntityBase.__init__(self, device)
     MjpegCamera.__init__(self, config)