Add person tracking for UniFi Protect (#111289)

This commit is contained in:
Christopher Bailey 2024-02-29 21:26:24 -05:00 committed by GitHub
parent 72fe170dc8
commit 5890a7d38c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 0 deletions

View file

@ -273,6 +273,15 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
ufp_value="is_glass_break_detection_on",
ufp_perm=PermRequired.NO_WRITE,
),
ProtectBinaryEntityDescription(
key="track_person",
name="Tracking: Person",
icon="mdi:walk",
entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="is_ptz",
ufp_value="is_person_tracking_enabled",
ufp_perm=PermRequired.NO_WRITE,
),
)
LIGHT_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (

View file

@ -298,6 +298,16 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
ufp_set_method="set_glass_break_detection",
ufp_perm=PermRequired.WRITE,
),
ProtectSwitchEntityDescription(
key="track_person",
name="Tracking: Person",
icon="mdi:walk",
entity_category=EntityCategory.CONFIG,
ufp_required_field="is_ptz",
ufp_value="is_person_tracking_enabled",
ufp_set_method="set_person_track",
ufp_perm=PermRequired.WRITE,
),
)
PRIVACY_MODE_SWITCH = ProtectSwitchEntityDescription[Camera](

View file

@ -37,6 +37,7 @@ CAMERA_SWITCHES_BASIC = [
not d.name.startswith("Detections:")
and d.name != "SSH Enabled"
and d.name != "Color Night Vision"
and d.name != "Tracking: Person"
)
or d.name == "Detections: Motion"
or d.name == "Detections: Person"