mirror of
https://github.com/home-assistant/core.git
synced 2025-05-29 10:17:08 +00:00

* Update python-homewizard-energy to 1.5.0 * Remove strict typing for now * Revert "Remove strict typing for now" This reverts commit ebcd327fdf3e10abcaabd6cd86a0bfc101b32fb1. * Adjust typing to resolve upstream changes
31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
"""Base entity for the HomeWizard integration."""
|
|
from __future__ import annotations
|
|
|
|
from homeassistant.const import ATTR_IDENTIFIERS
|
|
from homeassistant.helpers.entity import DeviceInfo
|
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
|
|
|
from .const import DOMAIN
|
|
from .coordinator import HWEnergyDeviceUpdateCoordinator
|
|
|
|
|
|
class HomeWizardEntity(CoordinatorEntity[HWEnergyDeviceUpdateCoordinator]):
|
|
"""Defines a HomeWizard entity."""
|
|
|
|
_attr_has_entity_name = True
|
|
|
|
def __init__(self, coordinator: HWEnergyDeviceUpdateCoordinator) -> None:
|
|
"""Initialize the HomeWizard entity."""
|
|
super().__init__(coordinator=coordinator)
|
|
self._attr_device_info = DeviceInfo(
|
|
name=coordinator.entry.title,
|
|
manufacturer="HomeWizard",
|
|
sw_version=coordinator.data.device.firmware_version,
|
|
model=coordinator.data.device.product_type,
|
|
)
|
|
|
|
if coordinator.data.device.serial is not None:
|
|
self._attr_device_info[ATTR_IDENTIFIERS] = {
|
|
(DOMAIN, coordinator.data.device.serial)
|
|
}
|