mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Migrate Filesize to new entity naming style (#75199)
This commit is contained in:
parent
3f6e930489
commit
54a939e223
@ -119,6 +119,7 @@ class FilesizeEntity(CoordinatorEntity[FileSizeCoordinator], SensorEntity):
|
||||
"""Filesize sensor."""
|
||||
|
||||
entity_description: SensorEntityDescription
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@ -130,7 +131,7 @@ class FilesizeEntity(CoordinatorEntity[FileSizeCoordinator], SensorEntity):
|
||||
"""Initialize the Filesize sensor."""
|
||||
super().__init__(coordinator)
|
||||
base_name = path.split("/")[-1]
|
||||
self._attr_name = f"{base_name} {description.name}"
|
||||
self._attr_name = description.name
|
||||
self._attr_unique_id = (
|
||||
entry_id if description.key == "file" else f"{entry_id}-{description.key}"
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user