mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
Add better support for UniFi Protect Cameras with Removable Lens (#76942)
This commit is contained in:
parent
0f0e398945
commit
ce3502291d
@ -190,6 +190,11 @@ class ProtectCamera(ProtectDeviceEntity, Camera):
|
|||||||
self._attr_is_recording = (
|
self._attr_is_recording = (
|
||||||
self.device.state == StateType.CONNECTED and self.device.is_recording
|
self.device.state == StateType.CONNECTED and self.device.is_recording
|
||||||
)
|
)
|
||||||
|
is_connected = (
|
||||||
|
self.data.last_update_success and self.device.state == StateType.CONNECTED
|
||||||
|
)
|
||||||
|
# some cameras have detachable lens that could cause the camera to be offline
|
||||||
|
self._attr_available = is_connected and self.device.is_video_ready
|
||||||
|
|
||||||
self._async_set_stream_source()
|
self._async_set_stream_source()
|
||||||
self._attr_extra_state_attributes = {
|
self._attr_extra_state_attributes = {
|
||||||
|
@ -200,6 +200,14 @@ CAMERA_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
|
|||||||
ufp_value="last_ring",
|
ufp_value="last_ring",
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
),
|
),
|
||||||
|
ProtectSensorEntityDescription(
|
||||||
|
key="lens_type",
|
||||||
|
name="Lens Type",
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
icon="mdi:camera-iris",
|
||||||
|
ufp_required_field="has_removable_lens",
|
||||||
|
ufp_value="feature_flags.lens_type",
|
||||||
|
),
|
||||||
ProtectSensorEntityDescription(
|
ProtectSensorEntityDescription(
|
||||||
key="mic_level",
|
key="mic_level",
|
||||||
name="Microphone Level",
|
name="Microphone Level",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user