add translation support

This commit is contained in:
pssc
2024-07-24 22:51:42 +01:00
parent 586d6478c2
commit 71704ae7ea
2 changed files with 11 additions and 2 deletions

View File

@@ -20,9 +20,8 @@ class LMSStatusEntity(CoordinatorEntity[LMSStatusDataUpdateCoordinator]):
) -> None: ) -> None:
"""Initialize status sensor entity.""" """Initialize status sensor entity."""
super().__init__(coordinator, context=description.key) super().__init__(coordinator, context=description.key)
self.coordinator = coordinator
self.entity_description = description self.entity_description = description
self._attr_name = description.key self._attr_translation_key = description.key
self._attr_unique_id = f"{coordinator.data[STATUS_QUERY_UUID]}{description.key}" self._attr_unique_id = f"{coordinator.data[STATUS_QUERY_UUID]}{description.key}"
self._attr_device_info = DeviceInfo( self._attr_device_info = DeviceInfo(

View File

@@ -75,5 +75,15 @@
"name": "Unsync", "name": "Unsync",
"description": "Removes this player from its sync group." "description": "Removes this player from its sync group."
} }
},
"entity": {
"binary_sensor": {
"rescan": {
"name": "rescan"
},
"needsrestart": {
"name": "needsrestart"
}
}
} }
} }