Fix ONVIF not displaying sensor and binary_sensor entity names (#151285)

This commit is contained in:
Felipe Santos
2025-08-28 06:58:13 -03:00
committed by GitHub
parent 08a850cfc7
commit da65c52f2d
2 changed files with 2 additions and 2 deletions

View File

@@ -74,7 +74,7 @@ class ONVIFBinarySensor(ONVIFBaseEntity, RestoreEntity, BinarySensorEntity):
BinarySensorDeviceClass, entry.original_device_class BinarySensorDeviceClass, entry.original_device_class
) )
self._attr_entity_category = entry.entity_category self._attr_entity_category = entry.entity_category
self._attr_name = entry.name self._attr_name = entry.name or entry.original_name
else: else:
event = device.events.get_uid(uid) event = device.events.get_uid(uid)
assert event assert event

View File

@@ -70,7 +70,7 @@ class ONVIFSensor(ONVIFBaseEntity, RestoreSensor):
SensorDeviceClass, entry.original_device_class SensorDeviceClass, entry.original_device_class
) )
self._attr_entity_category = entry.entity_category self._attr_entity_category = entry.entity_category
self._attr_name = entry.name self._attr_name = entry.name or entry.original_name
self._attr_native_unit_of_measurement = entry.unit_of_measurement self._attr_native_unit_of_measurement = entry.unit_of_measurement
else: else:
event = device.events.get_uid(uid) event = device.events.get_uid(uid)