Add has entity name to Solarlog (#97764)

pull/97777/head
Joost Lekkerkerker 2023-08-04 12:46:53 +02:00 committed by GitHub
parent ecce601d3f
commit 80d0f32237
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -218,6 +218,8 @@ async def async_setup_entry(
class SolarlogSensor(CoordinatorEntity[SolarlogData], SensorEntity):
"""Representation of a Sensor."""
_attr_has_entity_name = True
entity_description: SolarLogSensorEntityDescription
def __init__(
@ -228,7 +230,6 @@ class SolarlogSensor(CoordinatorEntity[SolarlogData], SensorEntity):
"""Initialize the sensor."""
super().__init__(coordinator)
self.entity_description = description
self._attr_name = f"{coordinator.name} {description.name}"
self._attr_unique_id = f"{coordinator.unique_id}_{description.key}"
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, coordinator.unique_id)},