Fix poolsense naming (#117567)

This commit is contained in:
Joost Lekkerkerker 2024-05-16 16:42:40 +02:00 committed by GitHub
parent d019c25ae4
commit ba395fb9f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,9 +1,10 @@
"""Base entity for poolsense integration."""
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity import EntityDescription
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import ATTRIBUTION
from .const import ATTRIBUTION, DOMAIN
from .coordinator import PoolSenseDataUpdateCoordinator
@ -11,6 +12,7 @@ class PoolSenseEntity(CoordinatorEntity[PoolSenseDataUpdateCoordinator]):
"""Implements a common class elements representing the PoolSense component."""
_attr_attribution = ATTRIBUTION
_attr_has_entity_name = True
def __init__(
self,
@ -21,5 +23,8 @@ class PoolSenseEntity(CoordinatorEntity[PoolSenseDataUpdateCoordinator]):
"""Initialize poolsense sensor."""
super().__init__(coordinator)
self.entity_description = description
self._attr_name = f"PoolSense {description.name}"
self._attr_unique_id = f"{email}-{description.key}"
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, email)},
model="PoolSense",
)