mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +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."""
|
"""Filesize sensor."""
|
||||||
|
|
||||||
entity_description: SensorEntityDescription
|
entity_description: SensorEntityDescription
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@ -130,7 +131,7 @@ class FilesizeEntity(CoordinatorEntity[FileSizeCoordinator], SensorEntity):
|
|||||||
"""Initialize the Filesize sensor."""
|
"""Initialize the Filesize sensor."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
base_name = path.split("/")[-1]
|
base_name = path.split("/")[-1]
|
||||||
self._attr_name = f"{base_name} {description.name}"
|
self._attr_name = description.name
|
||||||
self._attr_unique_id = (
|
self._attr_unique_id = (
|
||||||
entry_id if description.key == "file" else f"{entry_id}-{description.key}"
|
entry_id if description.key == "file" else f"{entry_id}-{description.key}"
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user