Add translations to Unifi Protect (#145548)

* Add translations to Unifi Protect

* address comments

* change `CO` to `CO alarm`
This commit is contained in:
Jan Rieger 2025-05-26 14:56:55 +02:00 committed by GitHub
parent 150110e221
commit ba0f6c3ba2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 642 additions and 207 deletions

View File

@ -65,13 +65,13 @@ MOUNT_DEVICE_CLASS_MAP = {
CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = ( CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="dark", key="dark",
name="Is dark", translation_key="is_dark",
icon="mdi:brightness-6", icon="mdi:brightness-6",
ufp_value="is_dark", ufp_value="is_dark",
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="ssh", key="ssh",
name="SSH enabled", translation_key="ssh_enabled",
icon="mdi:lock", icon="mdi:lock",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -80,7 +80,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="status_light", key="status_light",
name="Status light on", translation_key="status_light",
icon="mdi:led-on", icon="mdi:led-on",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="feature_flags.has_led_status", ufp_required_field="feature_flags.has_led_status",
@ -89,7 +89,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="hdr_mode", key="hdr_mode",
name="HDR mode", translation_key="hdr_mode",
icon="mdi:brightness-7", icon="mdi:brightness-7",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="feature_flags.has_hdr", ufp_required_field="feature_flags.has_hdr",
@ -98,7 +98,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="high_fps", key="high_fps",
name="High FPS", translation_key="high_fps",
icon="mdi:video-high-definition", icon="mdi:video-high-definition",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="feature_flags.has_highfps", ufp_required_field="feature_flags.has_highfps",
@ -107,7 +107,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="system_sounds", key="system_sounds",
name="System sounds", translation_key="system_sounds",
icon="mdi:speaker", icon="mdi:speaker",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="has_speaker", ufp_required_field="has_speaker",
@ -117,7 +117,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="osd_name", key="osd_name",
name="Overlay: show name", translation_key="overlay_show_name",
icon="mdi:fullscreen", icon="mdi:fullscreen",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="osd_settings.is_name_enabled", ufp_value="osd_settings.is_name_enabled",
@ -125,7 +125,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="osd_date", key="osd_date",
name="Overlay: show date", translation_key="overlay_show_date",
icon="mdi:fullscreen", icon="mdi:fullscreen",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="osd_settings.is_date_enabled", ufp_value="osd_settings.is_date_enabled",
@ -133,7 +133,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="osd_logo", key="osd_logo",
name="Overlay: show logo", translation_key="overlay_show_logo",
icon="mdi:fullscreen", icon="mdi:fullscreen",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="osd_settings.is_logo_enabled", ufp_value="osd_settings.is_logo_enabled",
@ -141,7 +141,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="osd_bitrate", key="osd_bitrate",
name="Overlay: show bitrate", translation_key="overlay_show_nerd_mode",
icon="mdi:fullscreen", icon="mdi:fullscreen",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="osd_settings.is_debug_enabled", ufp_value="osd_settings.is_debug_enabled",
@ -149,14 +149,14 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="motion_enabled", key="motion_enabled",
name="Detections: motion", translation_key="detections_motion",
icon="mdi:run-fast", icon="mdi:run-fast",
ufp_value="recording_settings.enable_motion_detection", ufp_value="recording_settings.enable_motion_detection",
ufp_perm=PermRequired.NO_WRITE, ufp_perm=PermRequired.NO_WRITE,
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="smart_person", key="smart_person",
name="Detections: person", translation_key="detections_person",
icon="mdi:walk", icon="mdi:walk",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="can_detect_person", ufp_required_field="can_detect_person",
@ -165,7 +165,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="smart_vehicle", key="smart_vehicle",
name="Detections: vehicle", translation_key="detections_vehicle",
icon="mdi:car", icon="mdi:car",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="can_detect_vehicle", ufp_required_field="can_detect_vehicle",
@ -174,7 +174,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="smart_animal", key="smart_animal",
name="Detections: animal", translation_key="detections_animal",
icon="mdi:paw", icon="mdi:paw",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="can_detect_animal", ufp_required_field="can_detect_animal",
@ -183,7 +183,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="smart_package", key="smart_package",
name="Detections: package", translation_key="detections_package",
icon="mdi:package-variant-closed", icon="mdi:package-variant-closed",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="can_detect_package", ufp_required_field="can_detect_package",
@ -192,7 +192,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="smart_licenseplate", key="smart_licenseplate",
name="Detections: license plate", translation_key="detections_license_plate",
icon="mdi:car", icon="mdi:car",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="can_detect_license_plate", ufp_required_field="can_detect_license_plate",
@ -201,7 +201,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="smart_smoke", key="smart_smoke",
name="Detections: smoke", translation_key="detections_smoke",
icon="mdi:fire", icon="mdi:fire",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="can_detect_smoke", ufp_required_field="can_detect_smoke",
@ -210,7 +210,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="smart_cmonx", key="smart_cmonx",
name="Detections: CO", translation_key="detections_co_alarm",
icon="mdi:molecule-co", icon="mdi:molecule-co",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="can_detect_co", ufp_required_field="can_detect_co",
@ -219,7 +219,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="smart_siren", key="smart_siren",
name="Detections: siren", translation_key="detections_siren",
icon="mdi:alarm-bell", icon="mdi:alarm-bell",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="can_detect_siren", ufp_required_field="can_detect_siren",
@ -228,7 +228,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="smart_baby_cry", key="smart_baby_cry",
name="Detections: baby cry", translation_key="detections_baby_cry",
icon="mdi:cradle", icon="mdi:cradle",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="can_detect_baby_cry", ufp_required_field="can_detect_baby_cry",
@ -237,7 +237,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="smart_speak", key="smart_speak",
name="Detections: speaking", translation_key="detections_speaking",
icon="mdi:account-voice", icon="mdi:account-voice",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="can_detect_speaking", ufp_required_field="can_detect_speaking",
@ -246,7 +246,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="smart_bark", key="smart_bark",
name="Detections: barking", translation_key="detections_barking",
icon="mdi:dog", icon="mdi:dog",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="can_detect_bark", ufp_required_field="can_detect_bark",
@ -255,7 +255,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="smart_car_alarm", key="smart_car_alarm",
name="Detections: car alarm", translation_key="detections_car_alarm",
icon="mdi:car", icon="mdi:car",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="can_detect_car_alarm", ufp_required_field="can_detect_car_alarm",
@ -264,7 +264,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="smart_car_horn", key="smart_car_horn",
name="Detections: car horn", translation_key="detections_car_horn",
icon="mdi:bugle", icon="mdi:bugle",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="can_detect_car_horn", ufp_required_field="can_detect_car_horn",
@ -273,7 +273,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="smart_glass_break", key="smart_glass_break",
name="Detections: glass break", translation_key="detections_glass_break",
icon="mdi:glass-fragile", icon="mdi:glass-fragile",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="can_detect_glass_break", ufp_required_field="can_detect_glass_break",
@ -282,7 +282,7 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="track_person", key="track_person",
name="Tracking: person", translation_key="tracking_person",
icon="mdi:walk", icon="mdi:walk",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="feature_flags.is_ptz", ufp_required_field="feature_flags.is_ptz",
@ -294,19 +294,18 @@ CAMERA_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
LIGHT_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = ( LIGHT_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="dark", key="dark",
name="Is dark", translation_key="is_dark",
icon="mdi:brightness-6", icon="mdi:brightness-6",
ufp_value="is_dark", ufp_value="is_dark",
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="motion", key="motion",
name="Motion detected",
device_class=BinarySensorDeviceClass.MOTION, device_class=BinarySensorDeviceClass.MOTION,
ufp_value="is_pir_motion_detected", ufp_value="is_pir_motion_detected",
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="light", key="light",
name="Flood light", translation_key="flood_light",
icon="mdi:spotlight-beam", icon="mdi:spotlight-beam",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="is_light_on", ufp_value="is_light_on",
@ -314,7 +313,7 @@ LIGHT_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="ssh", key="ssh",
name="SSH enabled", translation_key="ssh_enabled",
icon="mdi:lock", icon="mdi:lock",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -323,7 +322,7 @@ LIGHT_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="status_light", key="status_light",
name="Status light on", translation_key="status_light",
icon="mdi:led-on", icon="mdi:led-on",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="light_device_settings.is_indicator_enabled", ufp_value="light_device_settings.is_indicator_enabled",
@ -336,7 +335,7 @@ LIGHT_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
MOUNTABLE_SENSE_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = ( MOUNTABLE_SENSE_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key=_KEY_DOOR, key=_KEY_DOOR,
name="Contact", translation_key="contact",
device_class=BinarySensorDeviceClass.DOOR, device_class=BinarySensorDeviceClass.DOOR,
ufp_value="is_opened", ufp_value="is_opened",
ufp_enabled="is_contact_sensor_enabled", ufp_enabled="is_contact_sensor_enabled",
@ -346,34 +345,30 @@ MOUNTABLE_SENSE_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
SENSE_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = ( SENSE_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="leak", key="leak",
name="Leak",
device_class=BinarySensorDeviceClass.MOISTURE, device_class=BinarySensorDeviceClass.MOISTURE,
ufp_value="is_leak_detected", ufp_value="is_leak_detected",
ufp_enabled="is_leak_sensor_enabled", ufp_enabled="is_leak_sensor_enabled",
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="battery_low", key="battery_low",
name="Battery low",
device_class=BinarySensorDeviceClass.BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="battery_status.is_low", ufp_value="battery_status.is_low",
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="motion", key="motion",
name="Motion detected",
device_class=BinarySensorDeviceClass.MOTION, device_class=BinarySensorDeviceClass.MOTION,
ufp_value="is_motion_detected", ufp_value="is_motion_detected",
ufp_enabled="is_motion_sensor_enabled", ufp_enabled="is_motion_sensor_enabled",
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="tampering", key="tampering",
name="Tampering detected",
device_class=BinarySensorDeviceClass.TAMPER, device_class=BinarySensorDeviceClass.TAMPER,
ufp_value="is_tampering_detected", ufp_value="is_tampering_detected",
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="status_light", key="status_light",
name="Status light on", translation_key="status_light",
icon="mdi:led-on", icon="mdi:led-on",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="led_settings.is_enabled", ufp_value="led_settings.is_enabled",
@ -381,7 +376,7 @@ SENSE_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="motion_enabled", key="motion_enabled",
name="Motion detection", translation_key="detections_motion",
icon="mdi:walk", icon="mdi:walk",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="motion_settings.is_enabled", ufp_value="motion_settings.is_enabled",
@ -389,7 +384,7 @@ SENSE_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="temperature", key="temperature",
name="Temperature sensor", translation_key="temperature_sensor",
icon="mdi:thermometer", icon="mdi:thermometer",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="temperature_settings.is_enabled", ufp_value="temperature_settings.is_enabled",
@ -397,7 +392,7 @@ SENSE_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="humidity", key="humidity",
name="Humidity sensor", translation_key="humidity_sensor",
icon="mdi:water-percent", icon="mdi:water-percent",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="humidity_settings.is_enabled", ufp_value="humidity_settings.is_enabled",
@ -405,7 +400,7 @@ SENSE_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="light", key="light",
name="Light sensor", translation_key="light_sensor",
icon="mdi:brightness-5", icon="mdi:brightness-5",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="light_settings.is_enabled", ufp_value="light_settings.is_enabled",
@ -413,7 +408,7 @@ SENSE_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="alarm", key="alarm",
name="Alarm sound detection", translation_key="alarm_sound_detection",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="alarm_settings.is_enabled", ufp_value="alarm_settings.is_enabled",
ufp_perm=PermRequired.NO_WRITE, ufp_perm=PermRequired.NO_WRITE,
@ -423,7 +418,7 @@ SENSE_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = ( EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="doorbell", key="doorbell",
name="Doorbell", translation_key="doorbell",
device_class=BinarySensorDeviceClass.OCCUPANCY, device_class=BinarySensorDeviceClass.OCCUPANCY,
icon="mdi:doorbell-video", icon="mdi:doorbell-video",
ufp_required_field="feature_flags.is_doorbell", ufp_required_field="feature_flags.is_doorbell",
@ -431,14 +426,13 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
), ),
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="motion", key="motion",
name="Motion",
device_class=BinarySensorDeviceClass.MOTION, device_class=BinarySensorDeviceClass.MOTION,
ufp_enabled="is_motion_detection_on", ufp_enabled="is_motion_detection_on",
ufp_event_obj="last_motion_event", ufp_event_obj="last_motion_event",
), ),
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="smart_obj_any", key="smart_obj_any",
name="Object detected", translation_key="object_detected",
icon="mdi:eye", icon="mdi:eye",
ufp_required_field="feature_flags.has_smart_detect", ufp_required_field="feature_flags.has_smart_detect",
ufp_event_obj="last_smart_detect_event", ufp_event_obj="last_smart_detect_event",
@ -446,7 +440,7 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
), ),
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="smart_obj_person", key="smart_obj_person",
name="Person detected", translation_key="person_detected",
icon="mdi:walk", icon="mdi:walk",
ufp_obj_type=SmartDetectObjectType.PERSON, ufp_obj_type=SmartDetectObjectType.PERSON,
ufp_required_field="can_detect_person", ufp_required_field="can_detect_person",
@ -455,7 +449,7 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
), ),
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="smart_obj_vehicle", key="smart_obj_vehicle",
name="Vehicle detected", translation_key="vehicle_detected",
icon="mdi:car", icon="mdi:car",
ufp_obj_type=SmartDetectObjectType.VEHICLE, ufp_obj_type=SmartDetectObjectType.VEHICLE,
ufp_required_field="can_detect_vehicle", ufp_required_field="can_detect_vehicle",
@ -464,7 +458,7 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
), ),
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="smart_obj_animal", key="smart_obj_animal",
name="Animal detected", translation_key="animal_detected",
icon="mdi:paw", icon="mdi:paw",
ufp_obj_type=SmartDetectObjectType.ANIMAL, ufp_obj_type=SmartDetectObjectType.ANIMAL,
ufp_required_field="can_detect_animal", ufp_required_field="can_detect_animal",
@ -473,7 +467,7 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
), ),
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="smart_obj_package", key="smart_obj_package",
name="Package detected", translation_key="package_detected",
icon="mdi:package-variant-closed", icon="mdi:package-variant-closed",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
ufp_obj_type=SmartDetectObjectType.PACKAGE, ufp_obj_type=SmartDetectObjectType.PACKAGE,
@ -483,7 +477,7 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
), ),
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="smart_audio_any", key="smart_audio_any",
name="Audio object detected", translation_key="audio_object_detected",
icon="mdi:eye", icon="mdi:eye",
ufp_required_field="feature_flags.has_smart_detect", ufp_required_field="feature_flags.has_smart_detect",
ufp_event_obj="last_smart_audio_detect_event", ufp_event_obj="last_smart_audio_detect_event",
@ -491,7 +485,7 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
), ),
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="smart_audio_smoke", key="smart_audio_smoke",
name="Smoke alarm detected", translation_key="smoke_alarm_detected",
icon="mdi:fire", icon="mdi:fire",
ufp_obj_type=SmartDetectObjectType.SMOKE, ufp_obj_type=SmartDetectObjectType.SMOKE,
ufp_required_field="can_detect_smoke", ufp_required_field="can_detect_smoke",
@ -500,7 +494,7 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
), ),
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="smart_audio_cmonx", key="smart_audio_cmonx",
name="CO alarm detected", translation_key="co_alarm_detected",
icon="mdi:molecule-co", icon="mdi:molecule-co",
ufp_required_field="can_detect_co", ufp_required_field="can_detect_co",
ufp_enabled="is_co_detection_on", ufp_enabled="is_co_detection_on",
@ -509,7 +503,7 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
), ),
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="smart_audio_siren", key="smart_audio_siren",
name="Siren detected", translation_key="siren_detected",
icon="mdi:alarm-bell", icon="mdi:alarm-bell",
ufp_obj_type=SmartDetectObjectType.SIREN, ufp_obj_type=SmartDetectObjectType.SIREN,
ufp_required_field="can_detect_siren", ufp_required_field="can_detect_siren",
@ -518,7 +512,7 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
), ),
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="smart_audio_baby_cry", key="smart_audio_baby_cry",
name="Baby cry detected", translation_key="baby_cry_detected",
icon="mdi:cradle", icon="mdi:cradle",
ufp_obj_type=SmartDetectObjectType.BABY_CRY, ufp_obj_type=SmartDetectObjectType.BABY_CRY,
ufp_required_field="can_detect_baby_cry", ufp_required_field="can_detect_baby_cry",
@ -527,7 +521,7 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
), ),
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="smart_audio_speak", key="smart_audio_speak",
name="Speaking detected", translation_key="speaking_detected",
icon="mdi:account-voice", icon="mdi:account-voice",
ufp_obj_type=SmartDetectObjectType.SPEAK, ufp_obj_type=SmartDetectObjectType.SPEAK,
ufp_required_field="can_detect_speaking", ufp_required_field="can_detect_speaking",
@ -536,7 +530,7 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
), ),
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="smart_audio_bark", key="smart_audio_bark",
name="Barking detected", translation_key="barking_detected",
icon="mdi:dog", icon="mdi:dog",
ufp_obj_type=SmartDetectObjectType.BARK, ufp_obj_type=SmartDetectObjectType.BARK,
ufp_required_field="can_detect_bark", ufp_required_field="can_detect_bark",
@ -545,7 +539,7 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
), ),
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="smart_audio_car_alarm", key="smart_audio_car_alarm",
name="Car alarm detected", translation_key="car_alarm_detected",
icon="mdi:car", icon="mdi:car",
ufp_obj_type=SmartDetectObjectType.BURGLAR, ufp_obj_type=SmartDetectObjectType.BURGLAR,
ufp_required_field="can_detect_car_alarm", ufp_required_field="can_detect_car_alarm",
@ -554,7 +548,7 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
), ),
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="smart_audio_car_horn", key="smart_audio_car_horn",
name="Car horn detected", translation_key="car_horn_detected",
icon="mdi:bugle", icon="mdi:bugle",
ufp_obj_type=SmartDetectObjectType.CAR_HORN, ufp_obj_type=SmartDetectObjectType.CAR_HORN,
ufp_required_field="can_detect_car_horn", ufp_required_field="can_detect_car_horn",
@ -563,7 +557,7 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
), ),
ProtectBinaryEventEntityDescription( ProtectBinaryEventEntityDescription(
key="smart_audio_glass_break", key="smart_audio_glass_break",
name="Glass break detected", translation_key="glass_break_detected",
icon="mdi:glass-fragile", icon="mdi:glass-fragile",
ufp_obj_type=SmartDetectObjectType.GLASS_BREAK, ufp_obj_type=SmartDetectObjectType.GLASS_BREAK,
ufp_required_field="can_detect_glass_break", ufp_required_field="can_detect_glass_break",
@ -575,14 +569,13 @@ EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = (
DOORLOCK_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = ( DOORLOCK_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="battery_low", key="battery_low",
name="Battery low",
device_class=BinarySensorDeviceClass.BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="battery_status.is_low", ufp_value="battery_status.is_low",
), ),
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="status_light", key="status_light",
name="Status light on", translation_key="status_light",
icon="mdi:led-on", icon="mdi:led-on",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="led_settings.is_enabled", ufp_value="led_settings.is_enabled",
@ -593,7 +586,7 @@ DOORLOCK_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
VIEWER_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = ( VIEWER_SENSORS: tuple[ProtectBinaryEntityDescription, ...] = (
ProtectBinaryEntityDescription( ProtectBinaryEntityDescription(
key="ssh", key="ssh",
name="SSH enabled", translation_key="ssh_enabled",
icon="mdi:lock", icon="mdi:lock",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,

View File

@ -52,14 +52,13 @@ ALL_DEVICE_BUTTONS: tuple[ProtectButtonEntityDescription, ...] = (
key="reboot", key="reboot",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
device_class=ButtonDeviceClass.RESTART, device_class=ButtonDeviceClass.RESTART,
name="Reboot device",
ufp_press="reboot", ufp_press="reboot",
ufp_perm=PermRequired.WRITE, ufp_perm=PermRequired.WRITE,
), ),
ProtectButtonEntityDescription( ProtectButtonEntityDescription(
key="unadopt", key="unadopt",
translation_key="unadopt_device",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
name="Unadopt device",
icon="mdi:delete", icon="mdi:delete",
ufp_press="unadopt", ufp_press="unadopt",
ufp_perm=PermRequired.DELETE, ufp_perm=PermRequired.DELETE,
@ -68,7 +67,7 @@ ALL_DEVICE_BUTTONS: tuple[ProtectButtonEntityDescription, ...] = (
ADOPT_BUTTON = ProtectButtonEntityDescription[ProtectAdoptableDeviceModel]( ADOPT_BUTTON = ProtectButtonEntityDescription[ProtectAdoptableDeviceModel](
key="adopt", key="adopt",
name="Adopt device", translation_key="adopt_device",
icon="mdi:plus-circle", icon="mdi:plus-circle",
ufp_press="adopt", ufp_press="adopt",
) )
@ -76,7 +75,7 @@ ADOPT_BUTTON = ProtectButtonEntityDescription[ProtectAdoptableDeviceModel](
SENSOR_BUTTONS: tuple[ProtectButtonEntityDescription, ...] = ( SENSOR_BUTTONS: tuple[ProtectButtonEntityDescription, ...] = (
ProtectButtonEntityDescription( ProtectButtonEntityDescription(
key="clear_tamper", key="clear_tamper",
name="Clear tamper", translation_key="clear_tamper",
icon="mdi:notification-clear-all", icon="mdi:notification-clear-all",
ufp_press="clear_tamper", ufp_press="clear_tamper",
ufp_perm=PermRequired.WRITE, ufp_perm=PermRequired.WRITE,
@ -86,14 +85,14 @@ SENSOR_BUTTONS: tuple[ProtectButtonEntityDescription, ...] = (
CHIME_BUTTONS: tuple[ProtectButtonEntityDescription, ...] = ( CHIME_BUTTONS: tuple[ProtectButtonEntityDescription, ...] = (
ProtectButtonEntityDescription( ProtectButtonEntityDescription(
key="play", key="play",
name="Play chime", translation_key="play_chime",
device_class=DEVICE_CLASS_CHIME_BUTTON, device_class=DEVICE_CLASS_CHIME_BUTTON,
icon="mdi:play", icon="mdi:play",
ufp_press="play", ufp_press="play",
), ),
ProtectButtonEntityDescription( ProtectButtonEntityDescription(
key="play_buzzer", key="play_buzzer",
name="Play buzzer", translation_key="play_buzzer",
icon="mdi:play", icon="mdi:play",
ufp_press="play_buzzer", ufp_press="play_buzzer",
), ),

View File

@ -29,7 +29,9 @@ from .entity import ProtectDeviceEntity
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
_SPEAKER_DESCRIPTION = MediaPlayerEntityDescription( _SPEAKER_DESCRIPTION = MediaPlayerEntityDescription(
key="speaker", name="Speaker", device_class=MediaPlayerDeviceClass.SPEAKER key="speaker",
translation_key="speaker",
device_class=MediaPlayerDeviceClass.SPEAKER,
) )

View File

@ -64,7 +64,7 @@ def _get_chime_duration(obj: Camera) -> int:
CAMERA_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = ( CAMERA_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = (
ProtectNumberEntityDescription( ProtectNumberEntityDescription(
key="wdr_value", key="wdr_value",
name="Wide dynamic range", translation_key="wide_dynamic_range",
icon="mdi:state-machine", icon="mdi:state-machine",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_min=0, ufp_min=0,
@ -77,7 +77,7 @@ CAMERA_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = (
), ),
ProtectNumberEntityDescription( ProtectNumberEntityDescription(
key="mic_level", key="mic_level",
name="Microphone level", translation_key="microphone_level",
icon="mdi:microphone", icon="mdi:microphone",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
@ -92,7 +92,7 @@ CAMERA_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = (
), ),
ProtectNumberEntityDescription( ProtectNumberEntityDescription(
key="zoom_position", key="zoom_position",
name="Zoom level", translation_key="zoom_level",
icon="mdi:magnify-plus-outline", icon="mdi:magnify-plus-outline",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
@ -106,7 +106,7 @@ CAMERA_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = (
), ),
ProtectNumberEntityDescription( ProtectNumberEntityDescription(
key="chime_duration", key="chime_duration",
name="Chime duration", translation_key="chime_duration",
icon="mdi:bell", icon="mdi:bell",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
native_unit_of_measurement=UnitOfTime.SECONDS, native_unit_of_measurement=UnitOfTime.SECONDS,
@ -121,7 +121,7 @@ CAMERA_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = (
), ),
ProtectNumberEntityDescription( ProtectNumberEntityDescription(
key="icr_lux", key="icr_lux",
name="Infrared custom lux trigger", translation_key="infrared_custom_lux_trigger",
icon="mdi:white-balance-sunny", icon="mdi:white-balance-sunny",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_min=0, ufp_min=0,
@ -138,7 +138,7 @@ CAMERA_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = (
LIGHT_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = ( LIGHT_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = (
ProtectNumberEntityDescription( ProtectNumberEntityDescription(
key="sensitivity", key="sensitivity",
name="Motion sensitivity", translation_key="motion_sensitivity",
icon="mdi:walk", icon="mdi:walk",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
@ -152,7 +152,7 @@ LIGHT_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = (
), ),
ProtectNumberEntityDescription[Light]( ProtectNumberEntityDescription[Light](
key="duration", key="duration",
name="Auto-shutoff duration", translation_key="auto_shutoff_duration",
icon="mdi:camera-timer", icon="mdi:camera-timer",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
native_unit_of_measurement=UnitOfTime.SECONDS, native_unit_of_measurement=UnitOfTime.SECONDS,
@ -169,7 +169,7 @@ LIGHT_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = (
SENSE_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = ( SENSE_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = (
ProtectNumberEntityDescription( ProtectNumberEntityDescription(
key="sensitivity", key="sensitivity",
name="Motion sensitivity", translation_key="motion_sensitivity",
icon="mdi:walk", icon="mdi:walk",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
@ -186,7 +186,7 @@ SENSE_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = (
DOORLOCK_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = ( DOORLOCK_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = (
ProtectNumberEntityDescription[Doorlock]( ProtectNumberEntityDescription[Doorlock](
key="auto_lock_time", key="auto_lock_time",
name="Auto-lock timeout", translation_key="auto_lock_timeout",
icon="mdi:walk", icon="mdi:walk",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
native_unit_of_measurement=UnitOfTime.SECONDS, native_unit_of_measurement=UnitOfTime.SECONDS,
@ -203,7 +203,7 @@ DOORLOCK_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = (
CHIME_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = ( CHIME_NUMBERS: tuple[ProtectNumberEntityDescription, ...] = (
ProtectNumberEntityDescription( ProtectNumberEntityDescription(
key="volume", key="volume",
name="Volume", translation_key="volume",
icon="mdi:speaker", icon="mdi:speaker",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,

View File

@ -193,7 +193,7 @@ async def _set_liveview(obj: Viewer, liveview_id: str) -> None:
CAMERA_SELECTS: tuple[ProtectSelectEntityDescription, ...] = ( CAMERA_SELECTS: tuple[ProtectSelectEntityDescription, ...] = (
ProtectSelectEntityDescription( ProtectSelectEntityDescription(
key="recording_mode", key="recording_mode",
name="Recording mode", translation_key="recording_mode",
icon="mdi:video-outline", icon="mdi:video-outline",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_options=DEVICE_RECORDING_MODES, ufp_options=DEVICE_RECORDING_MODES,
@ -204,7 +204,7 @@ CAMERA_SELECTS: tuple[ProtectSelectEntityDescription, ...] = (
), ),
ProtectSelectEntityDescription( ProtectSelectEntityDescription(
key="infrared", key="infrared",
name="Infrared mode", translation_key="infrared_mode",
icon="mdi:circle-opacity", icon="mdi:circle-opacity",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="feature_flags.has_led_ir", ufp_required_field="feature_flags.has_led_ir",
@ -216,7 +216,7 @@ CAMERA_SELECTS: tuple[ProtectSelectEntityDescription, ...] = (
), ),
ProtectSelectEntityDescription[Camera]( ProtectSelectEntityDescription[Camera](
key="doorbell_text", key="doorbell_text",
name="Doorbell text", translation_key="doorbell_text",
icon="mdi:card-text", icon="mdi:card-text",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
device_class=DEVICE_CLASS_LCD_MESSAGE, device_class=DEVICE_CLASS_LCD_MESSAGE,
@ -228,7 +228,7 @@ CAMERA_SELECTS: tuple[ProtectSelectEntityDescription, ...] = (
), ),
ProtectSelectEntityDescription( ProtectSelectEntityDescription(
key="chime_type", key="chime_type",
name="Chime type", translation_key="chime_type",
icon="mdi:bell", icon="mdi:bell",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="feature_flags.has_chime", ufp_required_field="feature_flags.has_chime",
@ -240,7 +240,7 @@ CAMERA_SELECTS: tuple[ProtectSelectEntityDescription, ...] = (
), ),
ProtectSelectEntityDescription( ProtectSelectEntityDescription(
key="hdr_mode", key="hdr_mode",
name="HDR mode", translation_key="hdr_mode",
icon="mdi:brightness-7", icon="mdi:brightness-7",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="feature_flags.has_hdr", ufp_required_field="feature_flags.has_hdr",
@ -254,7 +254,7 @@ CAMERA_SELECTS: tuple[ProtectSelectEntityDescription, ...] = (
LIGHT_SELECTS: tuple[ProtectSelectEntityDescription, ...] = ( LIGHT_SELECTS: tuple[ProtectSelectEntityDescription, ...] = (
ProtectSelectEntityDescription[Light]( ProtectSelectEntityDescription[Light](
key=_KEY_LIGHT_MOTION, key=_KEY_LIGHT_MOTION,
name="Light mode", translation_key="light_mode",
icon="mdi:spotlight", icon="mdi:spotlight",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_options=MOTION_MODE_TO_LIGHT_MODE, ufp_options=MOTION_MODE_TO_LIGHT_MODE,
@ -264,7 +264,7 @@ LIGHT_SELECTS: tuple[ProtectSelectEntityDescription, ...] = (
), ),
ProtectSelectEntityDescription[Light]( ProtectSelectEntityDescription[Light](
key="paired_camera", key="paired_camera",
name="Paired camera", translation_key="paired_camera",
icon="mdi:cctv", icon="mdi:cctv",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="camera_id", ufp_value="camera_id",
@ -277,7 +277,7 @@ LIGHT_SELECTS: tuple[ProtectSelectEntityDescription, ...] = (
SENSE_SELECTS: tuple[ProtectSelectEntityDescription, ...] = ( SENSE_SELECTS: tuple[ProtectSelectEntityDescription, ...] = (
ProtectSelectEntityDescription( ProtectSelectEntityDescription(
key="mount_type", key="mount_type",
name="Mount type", translation_key="mount_type",
icon="mdi:screwdriver", icon="mdi:screwdriver",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_options=MOUNT_TYPES, ufp_options=MOUNT_TYPES,
@ -288,7 +288,7 @@ SENSE_SELECTS: tuple[ProtectSelectEntityDescription, ...] = (
), ),
ProtectSelectEntityDescription[Sensor]( ProtectSelectEntityDescription[Sensor](
key="paired_camera", key="paired_camera",
name="Paired camera", translation_key="paired_camera",
icon="mdi:cctv", icon="mdi:cctv",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="camera_id", ufp_value="camera_id",
@ -301,7 +301,7 @@ SENSE_SELECTS: tuple[ProtectSelectEntityDescription, ...] = (
DOORLOCK_SELECTS: tuple[ProtectSelectEntityDescription, ...] = ( DOORLOCK_SELECTS: tuple[ProtectSelectEntityDescription, ...] = (
ProtectSelectEntityDescription[Doorlock]( ProtectSelectEntityDescription[Doorlock](
key="paired_camera", key="paired_camera",
name="Paired camera", translation_key="paired_camera",
icon="mdi:cctv", icon="mdi:cctv",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="camera_id", ufp_value="camera_id",
@ -314,7 +314,7 @@ DOORLOCK_SELECTS: tuple[ProtectSelectEntityDescription, ...] = (
VIEWER_SELECTS: tuple[ProtectSelectEntityDescription, ...] = ( VIEWER_SELECTS: tuple[ProtectSelectEntityDescription, ...] = (
ProtectSelectEntityDescription[Viewer]( ProtectSelectEntityDescription[Viewer](
key="viewer", key="viewer",
name="Liveview", translation_key="liveview",
icon="mdi:view-dashboard", icon="mdi:view-dashboard",
entity_category=None, entity_category=None,
ufp_options_fn=_get_viewer_options, ufp_options_fn=_get_viewer_options,

View File

@ -125,7 +125,7 @@ def _get_alarm_sound(obj: Sensor) -> str:
ALL_DEVICES_SENSORS: tuple[ProtectSensorEntityDescription, ...] = ( ALL_DEVICES_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="uptime", key="uptime",
name="Uptime", translation_key="uptime",
icon="mdi:clock", icon="mdi:clock",
device_class=SensorDeviceClass.TIMESTAMP, device_class=SensorDeviceClass.TIMESTAMP,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -134,7 +134,7 @@ ALL_DEVICES_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="ble_signal", key="ble_signal",
name="Bluetooth signal strength", translation_key="bluetooth_signal_strength",
native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS_MILLIWATT, native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
device_class=SensorDeviceClass.SIGNAL_STRENGTH, device_class=SensorDeviceClass.SIGNAL_STRENGTH,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -145,7 +145,7 @@ ALL_DEVICES_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="phy_rate", key="phy_rate",
name="Link speed", translation_key="link_speed",
device_class=SensorDeviceClass.DATA_RATE, device_class=SensorDeviceClass.DATA_RATE,
native_unit_of_measurement=UnitOfDataRate.MEGABITS_PER_SECOND, native_unit_of_measurement=UnitOfDataRate.MEGABITS_PER_SECOND,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -156,7 +156,7 @@ ALL_DEVICES_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="wifi_signal", key="wifi_signal",
name="WiFi signal strength", translation_key="wifi_signal_strength",
native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS_MILLIWATT, native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
device_class=SensorDeviceClass.SIGNAL_STRENGTH, device_class=SensorDeviceClass.SIGNAL_STRENGTH,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
@ -170,7 +170,7 @@ ALL_DEVICES_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
CAMERA_SENSORS: tuple[ProtectSensorEntityDescription, ...] = ( CAMERA_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="oldest_recording", key="oldest_recording",
name="Oldest recording", translation_key="oldest_recording",
device_class=SensorDeviceClass.TIMESTAMP, device_class=SensorDeviceClass.TIMESTAMP,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
@ -178,7 +178,7 @@ CAMERA_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="storage_used", key="storage_used",
name="Storage used", translation_key="storage_used",
native_unit_of_measurement=UnitOfInformation.BYTES, native_unit_of_measurement=UnitOfInformation.BYTES,
device_class=SensorDeviceClass.DATA_SIZE, device_class=SensorDeviceClass.DATA_SIZE,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -189,7 +189,7 @@ CAMERA_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="write_rate", key="write_rate",
name="Disk write rate", translation_key="disk_write_rate",
device_class=SensorDeviceClass.DATA_RATE, device_class=SensorDeviceClass.DATA_RATE,
native_unit_of_measurement=UnitOfDataRate.BYTES_PER_SECOND, native_unit_of_measurement=UnitOfDataRate.BYTES_PER_SECOND,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -201,7 +201,6 @@ CAMERA_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="voltage", key="voltage",
name="Voltage",
device_class=SensorDeviceClass.VOLTAGE, device_class=SensorDeviceClass.VOLTAGE,
native_unit_of_measurement=UnitOfElectricPotential.VOLT, native_unit_of_measurement=UnitOfElectricPotential.VOLT,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -214,7 +213,7 @@ CAMERA_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="doorbell_last_trip_time", key="doorbell_last_trip_time",
name="Last doorbell ring", translation_key="last_doorbell_ring",
device_class=SensorDeviceClass.TIMESTAMP, device_class=SensorDeviceClass.TIMESTAMP,
icon="mdi:doorbell-video", icon="mdi:doorbell-video",
ufp_required_field="feature_flags.is_doorbell", ufp_required_field="feature_flags.is_doorbell",
@ -223,7 +222,7 @@ CAMERA_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="lens_type", key="lens_type",
name="Lens type", translation_key="lens_type",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:camera-iris", icon="mdi:camera-iris",
ufp_required_field="has_removable_lens", ufp_required_field="has_removable_lens",
@ -231,7 +230,7 @@ CAMERA_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="mic_level", key="mic_level",
name="Microphone level", translation_key="microphone_level",
icon="mdi:microphone", icon="mdi:microphone",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -242,7 +241,7 @@ CAMERA_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="recording_mode", key="recording_mode",
name="Recording mode", translation_key="recording_mode",
icon="mdi:video-outline", icon="mdi:video-outline",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="recording_settings.mode.value", ufp_value="recording_settings.mode.value",
@ -250,7 +249,7 @@ CAMERA_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="infrared", key="infrared",
name="Infrared mode", translation_key="infrared_mode",
icon="mdi:circle-opacity", icon="mdi:circle-opacity",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="feature_flags.has_led_ir", ufp_required_field="feature_flags.has_led_ir",
@ -259,7 +258,7 @@ CAMERA_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="doorbell_text", key="doorbell_text",
name="Doorbell text", translation_key="doorbell_text",
icon="mdi:card-text", icon="mdi:card-text",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_required_field="feature_flags.has_lcd_screen", ufp_required_field="feature_flags.has_lcd_screen",
@ -268,7 +267,7 @@ CAMERA_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="chime_type", key="chime_type",
name="Chime type", translation_key="chime_type",
icon="mdi:bell", icon="mdi:bell",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
@ -280,7 +279,7 @@ CAMERA_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
CAMERA_DISABLED_SENSORS: tuple[ProtectSensorEntityDescription, ...] = ( CAMERA_DISABLED_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="stats_rx", key="stats_rx",
name="Received data", translation_key="received_data",
native_unit_of_measurement=UnitOfInformation.BYTES, native_unit_of_measurement=UnitOfInformation.BYTES,
device_class=SensorDeviceClass.DATA_SIZE, device_class=SensorDeviceClass.DATA_SIZE,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
@ -292,7 +291,7 @@ CAMERA_DISABLED_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="stats_tx", key="stats_tx",
name="Transferred data", translation_key="transferred_data",
native_unit_of_measurement=UnitOfInformation.BYTES, native_unit_of_measurement=UnitOfInformation.BYTES,
device_class=SensorDeviceClass.DATA_SIZE, device_class=SensorDeviceClass.DATA_SIZE,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
@ -307,7 +306,6 @@ CAMERA_DISABLED_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
SENSE_SENSORS: tuple[ProtectSensorEntityDescription, ...] = ( SENSE_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="battery_level", key="battery_level",
name="Battery level",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=SensorDeviceClass.BATTERY, device_class=SensorDeviceClass.BATTERY,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -316,7 +314,6 @@ SENSE_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="light_level", key="light_level",
name="Light level",
native_unit_of_measurement=LIGHT_LUX, native_unit_of_measurement=LIGHT_LUX,
device_class=SensorDeviceClass.ILLUMINANCE, device_class=SensorDeviceClass.ILLUMINANCE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
@ -325,7 +322,6 @@ SENSE_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="humidity_level", key="humidity_level",
name="Humidity level",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=SensorDeviceClass.HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
@ -334,7 +330,6 @@ SENSE_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="temperature_level", key="temperature_level",
name="Temperature",
native_unit_of_measurement=UnitOfTemperature.CELSIUS, native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
@ -343,34 +338,34 @@ SENSE_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription[Sensor]( ProtectSensorEntityDescription[Sensor](
key="alarm_sound", key="alarm_sound",
name="Alarm sound detected", translation_key="alarm_sound_detected",
ufp_value_fn=_get_alarm_sound, ufp_value_fn=_get_alarm_sound,
ufp_enabled="is_alarm_sensor_enabled", ufp_enabled="is_alarm_sensor_enabled",
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="door_last_trip_time", key="door_last_trip_time",
name="Last open", translation_key="last_open",
device_class=SensorDeviceClass.TIMESTAMP, device_class=SensorDeviceClass.TIMESTAMP,
ufp_value="open_status_changed_at", ufp_value="open_status_changed_at",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="motion_last_trip_time", key="motion_last_trip_time",
name="Last motion detected", translation_key="last_motion_detected",
device_class=SensorDeviceClass.TIMESTAMP, device_class=SensorDeviceClass.TIMESTAMP,
ufp_value="motion_detected_at", ufp_value="motion_detected_at",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="tampering_last_trip_time", key="tampering_last_trip_time",
name="Last tampering detected", translation_key="last_tampering_detected",
device_class=SensorDeviceClass.TIMESTAMP, device_class=SensorDeviceClass.TIMESTAMP,
ufp_value="tampering_detected_at", ufp_value="tampering_detected_at",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="sensitivity", key="sensitivity",
name="Motion sensitivity", translation_key="sensitivity",
icon="mdi:walk", icon="mdi:walk",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -379,7 +374,7 @@ SENSE_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="mount_type", key="mount_type",
name="Mount type", translation_key="mount_type",
icon="mdi:screwdriver", icon="mdi:screwdriver",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="mount_type", ufp_value="mount_type",
@ -387,7 +382,7 @@ SENSE_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="paired_camera", key="paired_camera",
name="Paired camera", translation_key="paired_camera",
icon="mdi:cctv", icon="mdi:cctv",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="camera.display_name", ufp_value="camera.display_name",
@ -398,7 +393,6 @@ SENSE_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
DOORLOCK_SENSORS: tuple[ProtectSensorEntityDescription, ...] = ( DOORLOCK_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="battery_level", key="battery_level",
name="Battery level",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=SensorDeviceClass.BATTERY, device_class=SensorDeviceClass.BATTERY,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -407,7 +401,7 @@ DOORLOCK_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="paired_camera", key="paired_camera",
name="Paired camera", translation_key="paired_camera",
icon="mdi:cctv", icon="mdi:cctv",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="camera.display_name", ufp_value="camera.display_name",
@ -418,7 +412,7 @@ DOORLOCK_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
NVR_SENSORS: tuple[ProtectSensorEntityDescription, ...] = ( NVR_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="uptime", key="uptime",
name="Uptime", translation_key="uptime",
icon="mdi:clock", icon="mdi:clock",
device_class=SensorDeviceClass.TIMESTAMP, device_class=SensorDeviceClass.TIMESTAMP,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -426,7 +420,7 @@ NVR_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="storage_utilization", key="storage_utilization",
name="Storage utilization", translation_key="storage_utilization",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
icon="mdi:harddisk", icon="mdi:harddisk",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -436,7 +430,7 @@ NVR_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="record_rotating", key="record_rotating",
name="Type: timelapse video", translation_key="type_timelapse_video",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
icon="mdi:server", icon="mdi:server",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -446,7 +440,7 @@ NVR_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="record_timelapse", key="record_timelapse",
name="Type: continuous video", translation_key="type_continuous_video",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
icon="mdi:server", icon="mdi:server",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -456,7 +450,7 @@ NVR_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="record_detections", key="record_detections",
name="Type: detections video", translation_key="type_detections_video",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
icon="mdi:server", icon="mdi:server",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -466,7 +460,7 @@ NVR_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="resolution_HD", key="resolution_HD",
name="Resolution: HD video", translation_key="resolution_hd_video",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
icon="mdi:cctv", icon="mdi:cctv",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -476,7 +470,7 @@ NVR_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="resolution_4K", key="resolution_4K",
name="Resolution: 4K video", translation_key="resolution_4k_video",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
icon="mdi:cctv", icon="mdi:cctv",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -486,7 +480,7 @@ NVR_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="resolution_free", key="resolution_free",
name="Resolution: free space", translation_key="resolution_free_space",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
icon="mdi:cctv", icon="mdi:cctv",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -496,7 +490,7 @@ NVR_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription[NVR]( ProtectSensorEntityDescription[NVR](
key="record_capacity", key="record_capacity",
name="Recording capacity", translation_key="recording_capacity",
native_unit_of_measurement=UnitOfTime.SECONDS, native_unit_of_measurement=UnitOfTime.SECONDS,
icon="mdi:record-rec", icon="mdi:record-rec",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -508,7 +502,7 @@ NVR_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
NVR_DISABLED_SENSORS: tuple[ProtectSensorEntityDescription, ...] = ( NVR_DISABLED_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="cpu_utilization", key="cpu_utilization",
name="CPU utilization", translation_key="cpu_utilization",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
icon="mdi:speedometer", icon="mdi:speedometer",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
@ -518,7 +512,7 @@ NVR_DISABLED_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="cpu_temperature", key="cpu_temperature",
name="CPU temperature", translation_key="cpu_temperature",
native_unit_of_measurement=UnitOfTemperature.CELSIUS, native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
@ -528,7 +522,7 @@ NVR_DISABLED_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription[NVR]( ProtectSensorEntityDescription[NVR](
key="memory_utilization", key="memory_utilization",
name="Memory utilization", translation_key="memory_utilization",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
icon="mdi:memory", icon="mdi:memory",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
@ -542,9 +536,8 @@ NVR_DISABLED_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
LICENSE_PLATE_EVENT_SENSORS: tuple[ProtectSensorEventEntityDescription, ...] = ( LICENSE_PLATE_EVENT_SENSORS: tuple[ProtectSensorEventEntityDescription, ...] = (
ProtectSensorEventEntityDescription( ProtectSensorEventEntityDescription(
key="smart_obj_licenseplate", key="smart_obj_licenseplate",
name="License plate detected",
icon="mdi:car", icon="mdi:car",
translation_key="license_plate", translation_key="license_plate_detected",
ufp_obj_type=SmartDetectObjectType.LICENSE_PLATE, ufp_obj_type=SmartDetectObjectType.LICENSE_PLATE,
ufp_required_field="can_detect_license_plate", ufp_required_field="can_detect_license_plate",
ufp_event_obj="last_license_plate_detect_event", ufp_event_obj="last_license_plate_detect_event",
@ -555,14 +548,14 @@ LICENSE_PLATE_EVENT_SENSORS: tuple[ProtectSensorEventEntityDescription, ...] = (
LIGHT_SENSORS: tuple[ProtectSensorEntityDescription, ...] = ( LIGHT_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="motion_last_trip_time", key="motion_last_trip_time",
name="Last motion detected", translation_key="last_motion_detected",
device_class=SensorDeviceClass.TIMESTAMP, device_class=SensorDeviceClass.TIMESTAMP,
ufp_value="last_motion", ufp_value="last_motion",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="sensitivity", key="sensitivity",
name="Motion sensitivity", translation_key="motion_sensitivity",
icon="mdi:walk", icon="mdi:walk",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -571,7 +564,7 @@ LIGHT_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription[Light]( ProtectSensorEntityDescription[Light](
key="light_motion", key="light_motion",
name="Light mode", translation_key="light_mode",
icon="mdi:spotlight", icon="mdi:spotlight",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value_fn=async_get_light_motion_current, ufp_value_fn=async_get_light_motion_current,
@ -579,7 +572,7 @@ LIGHT_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="paired_camera", key="paired_camera",
name="Paired camera", translation_key="paired_camera",
icon="mdi:cctv", icon="mdi:cctv",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="camera.display_name", ufp_value="camera.display_name",
@ -590,7 +583,7 @@ LIGHT_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
MOTION_TRIP_SENSORS: tuple[ProtectSensorEntityDescription, ...] = ( MOTION_TRIP_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="motion_last_trip_time", key="motion_last_trip_time",
name="Last motion detected", translation_key="last_motion_detected",
device_class=SensorDeviceClass.TIMESTAMP, device_class=SensorDeviceClass.TIMESTAMP,
ufp_value="last_motion", ufp_value="last_motion",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
@ -600,14 +593,14 @@ MOTION_TRIP_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
CHIME_SENSORS: tuple[ProtectSensorEntityDescription, ...] = ( CHIME_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="last_ring", key="last_ring",
name="Last ring", translation_key="last_ring",
device_class=SensorDeviceClass.TIMESTAMP, device_class=SensorDeviceClass.TIMESTAMP,
icon="mdi:bell", icon="mdi:bell",
ufp_value="last_ring", ufp_value="last_ring",
), ),
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="volume", key="volume",
name="Volume", translation_key="volume",
icon="mdi:speaker", icon="mdi:speaker",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
@ -619,7 +612,7 @@ CHIME_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
VIEWER_SENSORS: tuple[ProtectSensorEntityDescription, ...] = ( VIEWER_SENSORS: tuple[ProtectSensorEntityDescription, ...] = (
ProtectSensorEntityDescription( ProtectSensorEntityDescription(
key="viewer", key="viewer",
name="Liveview", translation_key="liveview",
icon="mdi:view-dashboard", icon="mdi:view-dashboard",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
ufp_value="liveview.name", ufp_value="liveview.name",

View File

@ -128,16 +128,469 @@
} }
}, },
"entity": { "entity": {
"binary_sensor": {
"is_dark": {
"name": "Is dark"
},
"ssh_enabled": {
"name": "SSH enabled"
},
"status_light": {
"name": "Status light"
},
"hdr_mode": {
"name": "HDR mode"
},
"high_fps": {
"name": "High FPS"
},
"system_sounds": {
"name": "System sounds"
},
"overlay_show_name": {
"name": "Overlay: show name"
},
"overlay_show_date": {
"name": "Overlay: show date"
},
"overlay_show_logo": {
"name": "Overlay: show logo"
},
"overlay_show_nerd_mode": {
"name": "Overlay: show nerd mode"
},
"detections_motion": {
"name": "Detections: motion"
},
"detections_person": {
"name": "Detections: person"
},
"detections_vehicle": {
"name": "Detections: vehicle"
},
"detections_animal": {
"name": "Detections: animal"
},
"detections_package": {
"name": "Detections: package"
},
"detections_license_plate": {
"name": "Detections: license plate"
},
"detections_smoke": {
"name": "Detections: smoke"
},
"detections_co_alarm": {
"name": "Detections: CO alarm"
},
"detections_siren": {
"name": "Detections: siren"
},
"detections_baby_cry": {
"name": "Detections: baby cry"
},
"detections_speaking": {
"name": "Detections: speaking"
},
"detections_barking": {
"name": "Detections: barking"
},
"detections_car_alarm": {
"name": "Detections: car alarm"
},
"detections_car_horn": {
"name": "Detections: car horn"
},
"detections_glass_break": {
"name": "Detections: glass break"
},
"tracking_person": {
"name": "Tracking: person"
},
"flood_light": {
"name": "Flood light"
},
"contact": {
"name": "Contact"
},
"temperature_sensor": {
"name": "Temperature sensor"
},
"humidity_sensor": {
"name": "Humidity sensor"
},
"light_sensor": {
"name": "Light sensor"
},
"alarm_sound_detection": {
"name": "Alarm sound detection"
},
"doorbell": {
"name": "[%key:component::event::entity_component::doorbell::name%]"
},
"object_detected": {
"name": "Object detected"
},
"person_detected": {
"name": "Person detected"
},
"vehicle_detected": {
"name": "Vehicle detected"
},
"animal_detected": {
"name": "Animal detected"
},
"package_detected": {
"name": "Package detected"
},
"audio_object_detected": {
"name": "Audio object detected"
},
"smoke_alarm_detected": {
"name": "Smoke alarm detected"
},
"co_alarm_detected": {
"name": "CO alarm detected"
},
"siren_detected": {
"name": "Siren detected"
},
"baby_cry_detected": {
"name": "Baby cry detected"
},
"speaking_detected": {
"name": "Speaking detected"
},
"barking_detected": {
"name": "Barking detected"
},
"car_alarm_detected": {
"name": "Car alarm detected"
},
"car_horn_detected": {
"name": "Car horn detected"
},
"glass_break_detected": {
"name": "Glass break detected"
}
},
"button": {
"unadopt_device": {
"name": "Unadopt device"
},
"adopt_device": {
"name": "Adopt device"
},
"clear_tamper": {
"name": "Clear tamper"
},
"play_chime": {
"name": "Play chime"
},
"play_buzzer": {
"name": "Play buzzer"
}
},
"media_player": {
"speaker": {
"name": "[%key:component::media_player::entity_component::speaker::name%]"
}
},
"number": {
"wide_dynamic_range": {
"name": "Wide dynamic range"
},
"microphone_level": {
"name": "Microphone level"
},
"zoom_level": {
"name": "Zoom level"
},
"chime_duration": {
"name": "Chime duration"
},
"infrared_custom_lux_trigger": {
"name": "Infrared custom lux trigger"
},
"motion_sensitivity": {
"name": "Motion sensitivity"
},
"auto_shutoff_duration": {
"name": "Auto-shutoff duration"
},
"auto_lock_timeout": {
"name": "Auto-lock timeout"
},
"volume": {
"name": "[%key:component::sensor::entity_component::volume::name%]"
}
},
"select": {
"recording_mode": {
"name": "Recording mode"
},
"infrared_mode": {
"name": "Infrared mode"
},
"doorbell_text": {
"name": "Doorbell text"
},
"chime_type": {
"name": "Chime type"
},
"hdr_mode": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::hdr_mode::name%]"
},
"light_mode": {
"name": "Light mode"
},
"paired_camera": {
"name": "Paired camera"
},
"mount_type": {
"name": "Mount type"
},
"liveview": {
"name": "Liveview"
}
},
"sensor": { "sensor": {
"license_plate": { "uptime": {
"name": "Uptime"
},
"bluetooth_signal_strength": {
"name": "Bluetooth signal strength"
},
"link_speed": {
"name": "Link speed"
},
"wifi_signal_strength": {
"name": "WiFi signal strength"
},
"oldest_recording": {
"name": "Oldest recording"
},
"storage_used": {
"name": "Storage used"
},
"disk_write_rate": {
"name": "Disk write rate"
},
"last_doorbell_ring": {
"name": "Last doorbell ring"
},
"lens_type": {
"name": "Lens type"
},
"microphone_level": {
"name": "[%key:component::unifiprotect::entity::number::microphone_level::name%]"
},
"recording_mode": {
"name": "[%key:component::unifiprotect::entity::select::recording_mode::name%]"
},
"infrared_mode": {
"name": "[%key:component::unifiprotect::entity::select::infrared_mode::name%]"
},
"doorbell_text": {
"name": "[%key:component::unifiprotect::entity::select::doorbell_text::name%]"
},
"chime_type": {
"name": "[%key:component::unifiprotect::entity::select::chime_type::name%]"
},
"received_data": {
"name": "Received data"
},
"transferred_data": {
"name": "Transferred data"
},
"temperature": {
"name": "[%key:component::sensor::entity_component::temperature::name%]"
},
"alarm_sound_detected": {
"name": "Alarm sound detected"
},
"last_open": {
"name": "Last open"
},
"last_motion_detected": {
"name": "Last motion detected"
},
"last_tampering_detected": {
"name": "Last tampering detected"
},
"motion_sensitivity": {
"name": "[%key:component::unifiprotect::entity::number::motion_sensitivity::name%]"
},
"mount_type": {
"name": "[%key:component::unifiprotect::entity::select::mount_type::name%]"
},
"paired_camera": {
"name": "[%key:component::unifiprotect::entity::select::paired_camera::name%]"
},
"storage_utilization": {
"name": "Storage utilization"
},
"type_timelapse_video": {
"name": "Type: timelapse video"
},
"type_continuous_video": {
"name": "Type: continuous video"
},
"type_detections_video": {
"name": "Type: detections video"
},
"resolution_hd_video": {
"name": "Resolution: HD video"
},
"resolution_4k_video": {
"name": "Resolution: 4K video"
},
"resolution_free_space": {
"name": "Resolution: free space"
},
"recording_capacity": {
"name": "Recording capacity"
},
"cpu_utilization": {
"name": "CPU utilization"
},
"cpu_temperature": {
"name": "CPU temperature"
},
"memory_utilization": {
"name": "Memory utilization"
},
"license_plate_detected": {
"name": "License plate detected",
"state": { "state": {
"none": "Clear" "none": "[%key:component::binary_sensor::entity_component::gas::state::off%]"
} }
},
"light_mode": {
"name": "[%key:component::unifiprotect::entity::select::light_mode::name%]"
},
"last_ring": {
"name": "Last ring"
},
"volume": {
"name": "[%key:component::sensor::entity_component::volume::name%]"
},
"liveview": {
"name": "[%key:component::unifiprotect::entity::select::liveview::name%]"
}
},
"switch": {
"ssh_enabled": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::ssh_enabled::name%]"
},
"status_light": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::status_light::name%]"
},
"hdr_mode": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::hdr_mode::name%]"
},
"high_fps": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::high_fps::name%]"
},
"system_sounds": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::system_sounds::name%]"
},
"overlay_show_name": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::overlay_show_name::name%]"
},
"overlay_show_date": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::overlay_show_date::name%]"
},
"overlay_show_logo": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::overlay_show_logo::name%]"
},
"overlay_show_nerd_mode": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::overlay_show_nerd_mode::name%]"
},
"color_night_vision": {
"name": "Color night vision"
},
"motion": {
"name": "[%key:component::binary_sensor::entity_component::motion::name%]"
},
"detections_motion": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::detections_motion::name%]"
},
"detections_person": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::detections_person::name%]"
},
"detections_vehicle": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::detections_vehicle::name%]"
},
"detections_animal": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::detections_animal::name%]"
},
"detections_package": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::detections_package::name%]"
},
"detections_license_plate": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::detections_license_plate::name%]"
},
"detections_smoke": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::detections_smoke::name%]"
},
"detections_co_alarm": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::detections_co_alarm::name%]"
},
"detections_siren": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::detections_siren::name%]"
},
"detections_baby_cry": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::detections_baby_cry::name%]"
},
"detections_speak": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::detections_speaking::name%]"
},
"detections_barking": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::detections_barking::name%]"
},
"detections_car_alarm": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::detections_car_alarm::name%]"
},
"detections_car_horn": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::detections_car_horn::name%]"
},
"detections_glass_break": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::detections_glass_break::name%]"
},
"tracking_person": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::tracking_person::name%]"
},
"privacy_mode": {
"name": "Privacy mode"
},
"temperature_sensor": {
"name": "Temperature sensor"
},
"humidity_sensor": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::humidity_sensor::name%]"
},
"light_sensor": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::light_sensor::name%]"
},
"alarm_sound_detection": {
"name": "[%key:component::unifiprotect::entity::binary_sensor::alarm_sound_detection::name%]"
},
"analytics_enabled": {
"name": "Analytics enabled"
},
"insights_enabled": {
"name": "Insights enabled"
}
},
"text": {
"doorbell": {
"name": "[%key:component::event::entity_component::doorbell::name%]"
} }
}, },
"event": { "event": {
"doorbell": { "doorbell": {
"name": "Doorbell", "name": "[%key:component::event::entity_component::doorbell::name%]",
"state_attributes": { "state_attributes": {
"event_type": { "event_type": {
"state": { "state": {
@ -217,7 +670,7 @@
"description": "Removes a privacy zone from a camera.", "description": "Removes a privacy zone from a camera.",
"fields": { "fields": {
"device_id": { "device_id": {
"name": "Camera", "name": "[%key:component::camera::title%]",
"description": "Camera you want to remove the privacy zone from." "description": "Camera you want to remove the privacy zone from."
}, },
"name": { "name": {

View File

@ -52,7 +52,7 @@ async def _set_highfps(obj: Camera, value: bool) -> None:
CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = ( CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="ssh", key="ssh",
name="SSH enabled", translation_key="ssh_enabled",
icon="mdi:lock", icon="mdi:lock",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
@ -62,7 +62,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="status_light", key="status_light",
name="Status light on", translation_key="status_light",
icon="mdi:led-on", icon="mdi:led-on",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="feature_flags.has_led_status", ufp_required_field="feature_flags.has_led_status",
@ -72,7 +72,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="hdr_mode", key="hdr_mode",
name="HDR mode", translation_key="hdr_mode",
icon="mdi:brightness-7", icon="mdi:brightness-7",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
@ -83,7 +83,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription[Camera]( ProtectSwitchEntityDescription[Camera](
key="high_fps", key="high_fps",
name="High FPS", translation_key="high_fps",
icon="mdi:video-high-definition", icon="mdi:video-high-definition",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="feature_flags.has_highfps", ufp_required_field="feature_flags.has_highfps",
@ -93,7 +93,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="system_sounds", key="system_sounds",
name="System sounds", translation_key="system_sounds",
icon="mdi:speaker", icon="mdi:speaker",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="has_speaker", ufp_required_field="has_speaker",
@ -104,7 +104,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="osd_name", key="osd_name",
name="Overlay: show name", translation_key="overlay_show_name",
icon="mdi:fullscreen", icon="mdi:fullscreen",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="osd_settings.is_name_enabled", ufp_value="osd_settings.is_name_enabled",
@ -113,7 +113,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="osd_date", key="osd_date",
name="Overlay: show date", translation_key="overlay_show_date",
icon="mdi:fullscreen", icon="mdi:fullscreen",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="osd_settings.is_date_enabled", ufp_value="osd_settings.is_date_enabled",
@ -122,7 +122,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="osd_logo", key="osd_logo",
name="Overlay: show logo", translation_key="overlay_show_logo",
icon="mdi:fullscreen", icon="mdi:fullscreen",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="osd_settings.is_logo_enabled", ufp_value="osd_settings.is_logo_enabled",
@ -131,7 +131,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="osd_bitrate", key="osd_bitrate",
name="Overlay: show nerd mode", translation_key="overlay_show_nerd_mode",
icon="mdi:fullscreen", icon="mdi:fullscreen",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="osd_settings.is_debug_enabled", ufp_value="osd_settings.is_debug_enabled",
@ -140,7 +140,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="color_night_vision", key="color_night_vision",
name="Color night vision", translation_key="color_night_vision",
icon="mdi:light-flood-down", icon="mdi:light-flood-down",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="has_color_night_vision", ufp_required_field="has_color_night_vision",
@ -150,7 +150,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="motion", key="motion",
name="Detections: motion", translation_key="motion",
icon="mdi:run-fast", icon="mdi:run-fast",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="recording_settings.enable_motion_detection", ufp_value="recording_settings.enable_motion_detection",
@ -160,7 +160,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="smart_person", key="smart_person",
name="Detections: person", translation_key="detections_person",
icon="mdi:walk", icon="mdi:walk",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="can_detect_person", ufp_required_field="can_detect_person",
@ -171,7 +171,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="smart_vehicle", key="smart_vehicle",
name="Detections: vehicle", translation_key="detections_vehicle",
icon="mdi:car", icon="mdi:car",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="can_detect_vehicle", ufp_required_field="can_detect_vehicle",
@ -182,7 +182,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="smart_animal", key="smart_animal",
name="Detections: animal", translation_key="detections_animal",
icon="mdi:paw", icon="mdi:paw",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="can_detect_animal", ufp_required_field="can_detect_animal",
@ -193,7 +193,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="smart_package", key="smart_package",
name="Detections: package", translation_key="detections_package",
icon="mdi:package-variant-closed", icon="mdi:package-variant-closed",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="can_detect_package", ufp_required_field="can_detect_package",
@ -204,7 +204,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="smart_licenseplate", key="smart_licenseplate",
name="Detections: license plate", translation_key="detections_license_plate",
icon="mdi:car", icon="mdi:car",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="can_detect_license_plate", ufp_required_field="can_detect_license_plate",
@ -215,7 +215,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="smart_smoke", key="smart_smoke",
name="Detections: smoke", translation_key="detections_smoke",
icon="mdi:fire", icon="mdi:fire",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="can_detect_smoke", ufp_required_field="can_detect_smoke",
@ -226,7 +226,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="smart_cmonx", key="smart_cmonx",
name="Detections: CO", translation_key="detections_co_alarm",
icon="mdi:molecule-co", icon="mdi:molecule-co",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="can_detect_co", ufp_required_field="can_detect_co",
@ -237,7 +237,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="smart_siren", key="smart_siren",
name="Detections: siren", translation_key="detections_siren",
icon="mdi:alarm-bell", icon="mdi:alarm-bell",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="can_detect_siren", ufp_required_field="can_detect_siren",
@ -248,7 +248,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="smart_baby_cry", key="smart_baby_cry",
name="Detections: baby cry", translation_key="detections_baby_cry",
icon="mdi:cradle", icon="mdi:cradle",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="can_detect_baby_cry", ufp_required_field="can_detect_baby_cry",
@ -259,7 +259,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="smart_speak", key="smart_speak",
name="Detections: speaking", translation_key="detections_speak",
icon="mdi:account-voice", icon="mdi:account-voice",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="can_detect_speaking", ufp_required_field="can_detect_speaking",
@ -270,7 +270,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="smart_bark", key="smart_bark",
name="Detections: barking", translation_key="detections_bark",
icon="mdi:dog", icon="mdi:dog",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="can_detect_bark", ufp_required_field="can_detect_bark",
@ -281,7 +281,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="smart_car_alarm", key="smart_car_alarm",
name="Detections: car alarm", translation_key="detections_car_alarm",
icon="mdi:car", icon="mdi:car",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="can_detect_car_alarm", ufp_required_field="can_detect_car_alarm",
@ -292,7 +292,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="smart_car_horn", key="smart_car_horn",
name="Detections: car horn", translation_key="detections_car_horn",
icon="mdi:bugle", icon="mdi:bugle",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="can_detect_car_horn", ufp_required_field="can_detect_car_horn",
@ -303,7 +303,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="smart_glass_break", key="smart_glass_break",
name="Detections: glass break", translation_key="detections_glass_break",
icon="mdi:glass-fragile", icon="mdi:glass-fragile",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="can_detect_glass_break", ufp_required_field="can_detect_glass_break",
@ -314,7 +314,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="track_person", key="track_person",
name="Tracking: person", translation_key="tracking_person",
icon="mdi:walk", icon="mdi:walk",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="feature_flags.is_ptz", ufp_required_field="feature_flags.is_ptz",
@ -326,7 +326,7 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
PRIVACY_MODE_SWITCH = ProtectSwitchEntityDescription[Camera]( PRIVACY_MODE_SWITCH = ProtectSwitchEntityDescription[Camera](
key="privacy_mode", key="privacy_mode",
name="Privacy mode", translation_key="privacy_mode",
icon="mdi:eye-settings", icon="mdi:eye-settings",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_required_field="feature_flags.has_privacy_mask", ufp_required_field="feature_flags.has_privacy_mask",
@ -337,7 +337,7 @@ PRIVACY_MODE_SWITCH = ProtectSwitchEntityDescription[Camera](
SENSE_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = ( SENSE_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="status_light", key="status_light",
name="Status light on", translation_key="status_light",
icon="mdi:led-on", icon="mdi:led-on",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="led_settings.is_enabled", ufp_value="led_settings.is_enabled",
@ -346,7 +346,7 @@ SENSE_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="motion", key="motion",
name="Motion detection", translation_key="detections_motion",
icon="mdi:walk", icon="mdi:walk",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="motion_settings.is_enabled", ufp_value="motion_settings.is_enabled",
@ -355,7 +355,7 @@ SENSE_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="temperature", key="temperature",
name="Temperature sensor", translation_key="temperature_sensor",
icon="mdi:thermometer", icon="mdi:thermometer",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="temperature_settings.is_enabled", ufp_value="temperature_settings.is_enabled",
@ -364,7 +364,7 @@ SENSE_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="humidity", key="humidity",
name="Humidity sensor", translation_key="humidity_sensor",
icon="mdi:water-percent", icon="mdi:water-percent",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="humidity_settings.is_enabled", ufp_value="humidity_settings.is_enabled",
@ -373,7 +373,7 @@ SENSE_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="light", key="light",
name="Light sensor", translation_key="light_sensor",
icon="mdi:brightness-5", icon="mdi:brightness-5",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="light_settings.is_enabled", ufp_value="light_settings.is_enabled",
@ -382,7 +382,7 @@ SENSE_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="alarm", key="alarm",
name="Alarm sound detection", translation_key="alarm_sound_detection",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="alarm_settings.is_enabled", ufp_value="alarm_settings.is_enabled",
ufp_set_method="set_alarm_status", ufp_set_method="set_alarm_status",
@ -394,7 +394,7 @@ SENSE_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
LIGHT_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = ( LIGHT_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="ssh", key="ssh",
name="SSH enabled", translation_key="ssh_enabled",
icon="mdi:lock", icon="mdi:lock",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
@ -404,7 +404,7 @@ LIGHT_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="status_light", key="status_light",
name="Status light on", translation_key="status_light",
icon="mdi:led-on", icon="mdi:led-on",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="light_device_settings.is_indicator_enabled", ufp_value="light_device_settings.is_indicator_enabled",
@ -416,7 +416,7 @@ LIGHT_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
DOORLOCK_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = ( DOORLOCK_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="status_light", key="status_light",
name="Status light on", translation_key="status_light",
icon="mdi:led-on", icon="mdi:led-on",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="led_settings.is_enabled", ufp_value="led_settings.is_enabled",
@ -428,7 +428,7 @@ DOORLOCK_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
VIEWER_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = ( VIEWER_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="ssh", key="ssh",
name="SSH enabled", translation_key="ssh_enabled",
icon="mdi:lock", icon="mdi:lock",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
@ -441,7 +441,7 @@ VIEWER_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
NVR_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = ( NVR_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="analytics_enabled", key="analytics_enabled",
name="Analytics enabled", translation_key="analytics_enabled",
icon="mdi:google-analytics", icon="mdi:google-analytics",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="is_analytics_enabled", ufp_value="is_analytics_enabled",
@ -449,7 +449,7 @@ NVR_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = (
), ),
ProtectSwitchEntityDescription( ProtectSwitchEntityDescription(
key="insights_enabled", key="insights_enabled",
name="Insights enabled", translation_key="insights_enabled",
icon="mdi:magnify", icon="mdi:magnify",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value="is_insights_enabled", ufp_value="is_insights_enabled",

View File

@ -46,7 +46,7 @@ async def _set_doorbell_message(obj: Camera, message: str) -> None:
CAMERA: tuple[ProtectTextEntityDescription, ...] = ( CAMERA: tuple[ProtectTextEntityDescription, ...] = (
ProtectTextEntityDescription( ProtectTextEntityDescription(
key="doorbell", key="doorbell",
name="Doorbell", translation_key="doorbell",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
ufp_value_fn=_get_doorbell_current, ufp_value_fn=_get_doorbell_current,
ufp_set_method_fn=_set_doorbell_message, ufp_set_method_fn=_set_doorbell_message,

View File

@ -48,7 +48,7 @@ async def test_reboot_button(
ufp.api.reboot_device = AsyncMock() ufp.api.reboot_device = AsyncMock()
unique_id = f"{chime.mac}_reboot" unique_id = f"{chime.mac}_reboot"
entity_id = "button.test_chime_reboot_device" entity_id = "button.test_chime_restart"
entity = entity_registry.async_get(entity_id) entity = entity_registry.async_get(entity_id)
assert entity assert entity

View File

@ -34,22 +34,21 @@ CAMERA_SWITCHES_BASIC = [
d d
for d in CAMERA_SWITCHES for d in CAMERA_SWITCHES
if ( if (
not d.name.startswith("Detections:") not d.translation_key.startswith("detections_")
and d.name and d.key not in {"ssh", "color_night_vision", "track_person", "hdr_mode"}
not in {"SSH enabled", "Color night vision", "Tracking: person", "HDR mode"}
) )
or d.name or d.key
in { in {
"Detections: motion", "detections_motion",
"Detections: person", "detections_person",
"Detections: vehicle", "detections_vehicle",
"Detections: animal", "detections_animal",
} }
] ]
CAMERA_SWITCHES_NO_EXTRA = [ CAMERA_SWITCHES_NO_EXTRA = [
d d
for d in CAMERA_SWITCHES_BASIC for d in CAMERA_SWITCHES_BASIC
if d.name not in ("High FPS", "Privacy mode", "HDR mode") if d.key not in ("high_fps", "privacy_mode", "hdr_mode")
] ]
@ -152,7 +151,7 @@ async def test_switch_setup_light(
description = LIGHT_SWITCHES[0] description = LIGHT_SWITCHES[0]
unique_id = f"{light.mac}_{description.key}" unique_id = f"{light.mac}_{description.key}"
entity_id = f"switch.test_light_{description.name.lower().replace(' ', '_')}" entity_id = f"switch.test_light_{description.translation_key}"
entity = entity_registry.async_get(entity_id) entity = entity_registry.async_get(entity_id)
assert entity assert entity
@ -194,11 +193,8 @@ async def test_switch_setup_camera_all(
description = CAMERA_SWITCHES[0] description = CAMERA_SWITCHES[0]
description_entity_name = (
description.name.lower().replace(":", "").replace(" ", "_")
)
unique_id = f"{doorbell.mac}_{description.key}" unique_id = f"{doorbell.mac}_{description.key}"
entity_id = f"switch.test_camera_{description_entity_name}" entity_id = f"switch.test_camera_{description.translation_key}"
entity = entity_registry.async_get(entity_id) entity = entity_registry.async_get(entity_id)
assert entity assert entity
@ -243,11 +239,8 @@ async def test_switch_setup_camera_none(
description = CAMERA_SWITCHES[0] description = CAMERA_SWITCHES[0]
description_entity_name = (
description.name.lower().replace(":", "").replace(" ", "_")
)
unique_id = f"{camera.mac}_{description.key}" unique_id = f"{camera.mac}_{description.key}"
entity_id = f"switch.test_camera_{description_entity_name}" entity_id = f"switch.test_camera_{description.translation_key}"
entity = entity_registry.async_get(entity_id) entity = entity_registry.async_get(entity_id)
assert entity assert entity

View File

@ -109,8 +109,10 @@ def ids_from_device_description(
entity_name = normalize_name(device.display_name) entity_name = normalize_name(device.display_name)
if description.name and isinstance(description.name, str): if getattr(description, "translation_key", None):
description_entity_name = normalize_name(description.name) description_entity_name = normalize_name(description.translation_key)
elif getattr(description, "device_class", None):
description_entity_name = normalize_name(description.device_class)
else: else:
description_entity_name = normalize_name(description.key) description_entity_name = normalize_name(description.key)