@@ -141,9 +141,13 @@ def __init__(self, sensor_info, hass, entry, bank_name, dongle_id):
141141 @property
142142 def name (self ):
143143 """Return the name of the sensor."""
144- # When has_entity_name is True, just return the entity name
145- # Home Assistant will combine it with the device name
146- return self ._name
144+ # If single dongle (has_entity_name is False), return just the name
145+ # If multiple dongles (has_entity_name is True), return entity name only
146+ if self ._attr_has_entity_name :
147+ return self ._name
148+ else :
149+ # For single dongle, return a clean name without device prefix
150+ return self ._name
147151
148152 @property
149153 def unique_id (self ):
@@ -275,9 +279,13 @@ def __init__(self, sensor_info, hass, entry, bank_name, dongle_id):
275279 @property
276280 def name (self ):
277281 """Return the name of the sensor."""
278- # When has_entity_name is True, just return the entity name
279- # Home Assistant will combine it with the device name
280- return self ._name
282+ # If single dongle (has_entity_name is False), return just the name
283+ # If multiple dongles (has_entity_name is True), return entity name only
284+ if self ._attr_has_entity_name :
285+ return self ._name
286+ else :
287+ # For single dongle, return a clean name without device prefix
288+ return self ._name
281289
282290 @property
283291 def unique_id (self ):
@@ -348,9 +356,13 @@ def __init__(self, sensor_info, hass, entry, bank_name, dongle_id):
348356 @property
349357 def name (self ):
350358 """Return the name of the sensor."""
351- # When has_entity_name is True, just return the entity name
352- # Home Assistant will combine it with the device name
353- return self ._name
359+ # If single dongle (has_entity_name is False), return just the name
360+ # If multiple dongles (has_entity_name is True), return entity name only
361+ if self ._attr_has_entity_name :
362+ return self ._name
363+ else :
364+ # For single dongle, return a clean name without device prefix
365+ return self ._name
354366
355367 @property
356368 def unique_id (self ):
@@ -499,9 +511,13 @@ def __init__(self, sensor_info, hass, entry, bank_name, dongle_id):
499511 @property
500512 def name (self ):
501513 """Return the name of the sensor."""
502- # When has_entity_name is True, just return the entity name
503- # Home Assistant will combine it with the device name
504- return self ._name
514+ # If single dongle (has_entity_name is False), return just the name
515+ # If multiple dongles (has_entity_name is True), return entity name only
516+ if self ._attr_has_entity_name :
517+ return self ._name
518+ else :
519+ # For single dongle, return a clean name without device prefix
520+ return self ._name
505521
506522 @property
507523 def unique_id (self ):
0 commit comments