1
0
mirror of https://github.com/home-assistant/core.git synced 2026-03-04 08:40:04 +00:00
Files
core/homeassistant/components/indevolt/entity.py
A. Gideonse f6f52005fe Add Indevolt integration (#160595)
Co-authored-by: Joostlek <joostlek@outlook.com>
2026-02-17 15:51:55 +01:00

32 lines
1.0 KiB
Python

"""Base entity for Indevolt integration."""
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN
from .coordinator import IndevoltCoordinator
class IndevoltEntity(CoordinatorEntity[IndevoltCoordinator]):
"""Base Indevolt entity with up-to-date device info."""
_attr_has_entity_name = True
@property
def serial_number(self) -> str:
"""Return the device serial number."""
return self.coordinator.serial_number
@property
def device_info(self) -> DeviceInfo:
"""Return device information for registry."""
coordinator = self.coordinator
return DeviceInfo(
identifiers={(DOMAIN, coordinator.serial_number)},
manufacturer="INDEVOLT",
serial_number=coordinator.serial_number,
model=coordinator.device_model,
sw_version=coordinator.firmware_version,
hw_version=str(coordinator.generation),
)