1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-08 17:49:37 +01:00

Translate Hikvision NVR channel device name (#160862)

This commit is contained in:
Joost Lekkerkerker
2026-01-14 16:16:26 +01:00
committed by GitHub
parent 9e6073099c
commit 766a50abd7
4 changed files with 17 additions and 4 deletions
@@ -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",
)
+5 -1
View File
@@ -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",
)
@@ -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.",
@@ -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': <CameraEntityFeature: 2>,
}),
'context': <ANY>,
@@ -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': <CameraEntityFeature: 2>,
}),
'context': <ANY>,