Add BaseEntity for apsystems integration (#117514)
* Add BaseEntity for apsystems integration * Exclude entity.py from apsystems from coverage * Remove api from BaseEntity from apsystems as it is not yet used * Split BaseEntity and BaseCoordinatorEntity in apsystems integration * Clean up of asserting unique_id everywhere in apsystems integration * Remove BaseCoordinatorEntity from apsystems * Remove double type declaration originating from merge in apsystems
This commit is contained in:
parent
78e5f9578c
commit
c23ec96174
4 changed files with 58 additions and 21 deletions
27
homeassistant/components/apsystems/entity.py
Normal file
27
homeassistant/components/apsystems/entity.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
"""APsystems base entity."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.helpers.device_registry import DeviceInfo
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
from . import ApSystemsData
|
||||
from .const import DOMAIN
|
||||
|
||||
|
||||
class ApSystemsEntity(Entity):
|
||||
"""Defines a base APsystems entity."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
data: ApSystemsData,
|
||||
) -> None:
|
||||
"""Initialize the APsystems entity."""
|
||||
self._attr_device_info = DeviceInfo(
|
||||
identifiers={(DOMAIN, data.device_id)},
|
||||
serial_number=data.device_id,
|
||||
manufacturer="APsystems",
|
||||
model="EZ1-M",
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue