From 171bed76375ab093a91d5ef60033cc397f0a160d Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 5 Dec 2022 20:10:36 +0100 Subject: [PATCH] Migrate UniFi Protect translations (#83338) * Migrate UniFi Protect translations * Move key --- homeassistant/components/unifiprotect/sensor.py | 5 ++--- homeassistant/components/unifiprotect/strings.json | 9 +++++++++ .../components/unifiprotect/strings.sensor.json | 7 ------- .../components/unifiprotect/translations/en.json | 9 +++++++++ 4 files changed, 20 insertions(+), 10 deletions(-) delete mode 100644 homeassistant/components/unifiprotect/strings.sensor.json diff --git a/homeassistant/components/unifiprotect/sensor.py b/homeassistant/components/unifiprotect/sensor.py index fa08892e2d38..9b22c00dbbdb 100644 --- a/homeassistant/components/unifiprotect/sensor.py +++ b/homeassistant/components/unifiprotect/sensor.py @@ -55,7 +55,6 @@ from .utils import async_dispatch_id as _ufpd, async_get_light_motion_current _LOGGER = logging.getLogger(__name__) OBJECT_TYPE_NONE = "none" DEVICE_CLASS_DETECTION = "unifiprotect__detection" -DEVICE_CLASS_LICENSE_PLATE = "unifiprotect__license_plate" @dataclass @@ -534,11 +533,11 @@ EVENT_SENSORS: tuple[ProtectSensorEventEntityDescription, ...] = ( key="smart_obj_licenseplate", name="License Plate Detected", icon="mdi:car", - device_class=DEVICE_CLASS_LICENSE_PLATE, + translation_key="license_plate", + ufp_smart_type=SmartDetectObjectType.LICENSE_PLATE, ufp_value="is_smart_detected", ufp_required_field="can_detect_license_plate", ufp_event_obj="last_smart_detect_event", - ufp_smart_type=SmartDetectObjectType.LICENSE_PLATE, ), ) diff --git a/homeassistant/components/unifiprotect/strings.json b/homeassistant/components/unifiprotect/strings.json index 8bdd844fdbf7..7abf01461c33 100644 --- a/homeassistant/components/unifiprotect/strings.json +++ b/homeassistant/components/unifiprotect/strings.json @@ -80,5 +80,14 @@ "title": "Smart Detection Sensor Deprecated", "description": "The unified \"Detected Object\" sensor for smart detections is now deprecated. It has been replaced with individual smart detection binary sensors for each smart detection type. Please update any templates or automations accordingly." } + }, + "entity": { + "sensor": { + "license_plate": { + "state": { + "none": "Clear" + } + } + } } } diff --git a/homeassistant/components/unifiprotect/strings.sensor.json b/homeassistant/components/unifiprotect/strings.sensor.json deleted file mode 100644 index ccb16e2d4457..000000000000 --- a/homeassistant/components/unifiprotect/strings.sensor.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "state": { - "unifiprotect__license_plate": { - "none": "Clear" - } - } -} diff --git a/homeassistant/components/unifiprotect/translations/en.json b/homeassistant/components/unifiprotect/translations/en.json index 21b3cd643608..cbe58858bf10 100644 --- a/homeassistant/components/unifiprotect/translations/en.json +++ b/homeassistant/components/unifiprotect/translations/en.json @@ -41,6 +41,15 @@ } } }, + "entity": { + "sensor": { + "license_plate": { + "state": { + "none": "Clear" + } + } + } + }, "issues": { "deprecate_smart_sensor": { "description": "The unified \"Detected Object\" sensor for smart detections is now deprecated. It has been replaced with individual smart detection binary sensors for each smart detection type. Please update any templates or automations accordingly.",