diff --git a/homeassistant/components/hikvision/binary_sensor.py b/homeassistant/components/hikvision/binary_sensor.py index 192248e3aac..a529185eda2 100644 --- a/homeassistant/components/hikvision/binary_sensor.py +++ b/homeassistant/components/hikvision/binary_sensor.py @@ -191,7 +191,11 @@ class HikvisionBinarySensor(BinarySensorEntity): self._attr_device_info = DeviceInfo( identifiers={(DOMAIN, f"{self._data.device_id}_{channel}")}, via_device=(DOMAIN, self._data.device_id), - name=f"{self._data.device_name} Channel {channel}", + translation_key="nvr_channel", + translation_placeholders={ + "device_name": self._data.device_name, + "channel_number": str(channel), + }, manufacturer="Hikvision", model="NVR Channel", ) diff --git a/homeassistant/components/hikvision/camera.py b/homeassistant/components/hikvision/camera.py index 19518e8daa9..c369c6d3c41 100644 --- a/homeassistant/components/hikvision/camera.py +++ b/homeassistant/components/hikvision/camera.py @@ -62,7 +62,11 @@ class HikvisionCamera(Camera): self._attr_device_info = DeviceInfo( identifiers={(DOMAIN, f"{self._data.device_id}_{channel}")}, via_device=(DOMAIN, self._data.device_id), - name=f"{self._data.device_name} Channel {channel}", + translation_key="nvr_channel", + translation_placeholders={ + "device_name": self._data.device_name, + "channel_number": str(channel), + }, manufacturer="Hikvision", model="NVR Channel", ) diff --git a/homeassistant/components/hikvision/strings.json b/homeassistant/components/hikvision/strings.json index ca25cccf772..0b5241bdd29 100644 --- a/homeassistant/components/hikvision/strings.json +++ b/homeassistant/components/hikvision/strings.json @@ -29,6 +29,11 @@ } } }, + "device": { + "nvr_channel": { + "name": "{device_name} channel {channel_number}" + } + }, "issues": { "deprecated_yaml_import_issue": { "description": "Configuring {integration_title} using YAML is deprecated and the import failed. Please remove the `{domain}` entry from your `configuration.yaml` file and set up the integration manually.", diff --git a/tests/components/hikvision/snapshots/test_camera.ambr b/tests/components/hikvision/snapshots/test_camera.ambr index a2f61d6a95f..00c5ba5dfb3 100644 --- a/tests/components/hikvision/snapshots/test_camera.ambr +++ b/tests/components/hikvision/snapshots/test_camera.ambr @@ -92,7 +92,7 @@ 'attributes': ReadOnlyDict({ 'access_token': '1caab5c3b3', 'entity_picture': '/api/camera_proxy/camera.front_camera_channel_1?token=1caab5c3b3', - 'friendly_name': 'Front Camera Channel 1', + 'friendly_name': 'Front Camera channel 1', 'supported_features': , }), 'context': , @@ -144,7 +144,7 @@ 'attributes': ReadOnlyDict({ 'access_token': '1caab5c3b3', 'entity_picture': '/api/camera_proxy/camera.front_camera_channel_2?token=1caab5c3b3', - 'friendly_name': 'Front Camera Channel 2', + 'friendly_name': 'Front Camera channel 2', 'supported_features': , }), 'context': ,