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,
        coordinator: DataUpdateCoordinator[State],
        client: Elgato,
        info: Info,
        mac: str | None,
        settings: Settings,
    ) -> None:
        """Initialize Elgato Light."""
        super().__init__(client, info, mac)
        CoordinatorEntity.__init__(self, coordinator)

        self._attr_min_mireds = 143
        self._attr_max_mireds = 344
        self._attr_name = info.display_name or info.product_name
        self._attr_supported_color_modes = {ColorMode.COLOR_TEMP}
        self._attr_unique_id = info.serial_number

        # Elgato Light supporting color, have a different temperature range
        if settings.power_on_hue is not None:
            self._attr_supported_color_modes = {
                ColorMode.COLOR_TEMP, ColorMode.HS
            }
            self._attr_min_mireds = 153
            self._attr_max_mireds = 285
Exemplo n.º 3
0
 def __init__(self, hass: HomeAssistant, entry: ConfigEntry,
              code_slot: int):
     """Initialize the sensor."""
     KeymasterTemplateEntity.__init__(self, hass, entry, SENSOR_DOMAIN,
                                      code_slot, "Code Slot")
     CoordinatorEntity.__init__(
         self, hass.data[DOMAIN][entry.entry_id][COORDINATOR])
Exemplo n.º 4
0
    def __init__(self,
                 login,
                 coordinator,
                 guard_entity,
                 media_players=None) -> None:
        # pylint: disable=unexpected-keyword-arg
        """Initialize the Alexa device."""
        AlexaMedia.__init__(self, None, login)
        CoordinatorEntity.__init__(self, coordinator)
        _LOGGER.debug("%s: Initiating alarm control panel",
                      hide_email(login.email))
        # AlexaAPI requires a AlexaClient object, need to clean this up

        # Guard info
        self._appliance_id = guard_entity["appliance_id"]
        self._guard_entity_id = guard_entity["id"]
        self._friendly_name = "Alexa Guard " + self._appliance_id[-5:]
        self._media_players = {} or media_players
        self._attrs: Dict[Text, Text] = {}
        _LOGGER.debug(
            "%s: Guard Discovered %s: %s %s",
            self.account,
            self._friendly_name,
            hide_serial(self._appliance_id),
            hide_serial(self._guard_entity_id),
        )
Exemplo n.º 5
0
 def __init__(
     self,
     api: SynoApi,
     entity_type: str,
     entity_info: Dict[str, str],
     coordinator: DataUpdateCoordinator,
 ):
     """Initialize the Synology DSM entity."""
     super().__init__(api, entity_type, entity_info)
     CoordinatorEntity.__init__(self, coordinator)
Exemplo n.º 6
0
 def __init__(
     self,
     coordinator: FrigateDataUpdateCoordinator,
     config_entry: ConfigEntry,
     detector_name: str,
 ) -> None:
     """Construct a DetectorSpeedSensor."""
     FrigateEntity.__init__(self, config_entry)
     CoordinatorEntity.__init__(self, coordinator)
     self._detector_name = detector_name
Exemplo n.º 7
0
 def __init__(
     self,
     coordinator: FrigateDataUpdateCoordinator,
     config_entry: ConfigEntry,
     cam_name: str,
     fps_type: str,
 ) -> None:
     """Construct a CameraFpsSensor."""
     FrigateEntity.__init__(self, config_entry)
     CoordinatorEntity.__init__(self, coordinator)
     self._cam_name = cam_name
     self._fps_type = fps_type
Exemplo n.º 8
0
 def _handle_coordinator_update(self) -> None:
     """Handle updated data from the coordinator."""
     available = False
     if self.coordinator.last_update_success:
         camera = get_camera_from_cameras(self._camera_id,
                                          self.coordinator.data)
         if self._is_acceptable_streaming_camera(camera):
             assert camera
             self._set_mjpeg_camera_state_for_camera(camera)
             self._motion_detection_enabled = camera.get(
                 KEY_MOTION_DETECTION, False)
             available = True
     self._available = available
     CoordinatorEntity._handle_coordinator_update(self)
Exemplo n.º 9
0
 def __init__(self, coordinator: DataUpdateCoordinator, device: DysonDevice,
              name: str):
     CoordinatorEntity.__init__(self, coordinator)
     DysonSensor.__init__(self, device, name)
Exemplo n.º 10
0
 def __init__(
     self, coordinator: DataUpdateCoordinator, device: DysonDevice, name: str
 ):
     """Initialize the environmental sensor."""
     CoordinatorEntity.__init__(self, coordinator)
     DysonSensor.__init__(self, device, name)
Exemplo n.º 11
0
 def __init__(self, coordinator: DataUpdateCoordinator, device: DysonDevice,
              name: str):
     """Initialize the air quality entity."""
     CoordinatorEntity.__init__(self, coordinator)
     DysonEntity.__init__(self, device, name)
Exemplo n.º 12
0
 def __init__(self, coordinator: FrigateDataUpdateCoordinator,
              config_entry: ConfigEntry) -> None:
     """Construct a FrigateFpsSensor."""
     FrigateEntity.__init__(self, config_entry)
     CoordinatorEntity.__init__(self, coordinator)