Skip to content

Commit

Permalink
Fix poolsense naming (#117567)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored and frenck committed May 17, 2024
1 parent ab9ed0e commit 5cd101d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions homeassistant/components/poolsense/entity.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
"""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


class PoolSenseEntity(CoordinatorEntity[PoolSenseDataUpdateCoordinator]):
"""Implements a common class elements representing the PoolSense component."""

_attr_attribution = ATTRIBUTION
_attr_has_entity_name = True

def __init__(
self,
Expand All @@ -21,5 +23,8 @@ def __init__(
"""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",
)

0 comments on commit 5cd101d

Please sign in to comment.