Add Color Night Vision switch for UniFi Protect (#106500)

* Add a switch to enable and disable "Color Night Vision" for the Unifi Protect platform, which is a feature on the new G5 Pro cameras with a "Vision Enhancer" attached

* Updated tests for the new switch
This commit is contained in:
Mike Megally 2023-12-27 11:56:54 -08:00 committed by GitHub
parent 093c952c38
commit 9b2c67fcd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -209,6 +209,16 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
ufp_set_method="set_smoke_detection",
ufp_perm=PermRequired.WRITE,
),
ProtectSwitchEntityDescription(
key="color_night_vision",
name="Color Night Vision",
icon="mdi:light-flood-down",
entity_category=EntityCategory.CONFIG,
ufp_required_field="has_color_night_vision",
ufp_value="isp_settings.is_color_night_vision_enabled",
ufp_set_method="set_color_night_vision",
ufp_perm=PermRequired.WRITE,
),
)
PRIVACY_MODE_SWITCH = ProtectSwitchEntityDescription[Camera](

View File

@ -38,6 +38,7 @@ CAMERA_SWITCHES_BASIC = [
and d.name != "Detections: License Plate"
and d.name != "Detections: Smoke/CO"
and d.name != "SSH Enabled"
and d.name != "Color Night Vision"
]
CAMERA_SWITCHES_NO_EXTRA = [
d for d in CAMERA_SWITCHES_BASIC if d.name not in ("High FPS", "Privacy Mode")