* Add empty weheat integration * Add first sensor to weheat integration * Add weheat entity to provide device information * Fixed automatic selection for a single heat pump * Replaced integration specific package and removed status sensor * Update const.py * Add reauthentication support for weheat integration * Add test cases for the config flow of the weheat integration * Changed API and OATH url to weheat production environment * Add empty weheat integration * Add first sensor to weheat integration * Add weheat entity to provide device information * Fixed automatic selection for a single heat pump * Replaced integration specific package and removed status sensor * Add reauthentication support for weheat integration * Update const.py * Add test cases for the config flow of the weheat integration * Changed API and OATH url to weheat production environment * Resolved merge conflict after adding weheat package * Apply suggestions from code review Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * Added translation keys, more type info and version bump the weheat package * Adding native property value for weheat sensor * Removed reauth, added weheat sensor description and changed discovery of heat pumps * Added unique ID of user to entity * Replaced string by constants, added test case for duplicate unique id * Removed duplicate constant * Added offline scope * Removed re-auth related code * Simplified oath implementation * Cleanup tests for weheat integration * Added oath scope to tests --------- Co-authored-by: kjell-van-straaten <kjell.van.straaten@wefabricate.com> Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
27 lines
818 B
Python
27 lines
818 B
Python
"""Base entity for Weheat."""
|
|
|
|
from homeassistant.helpers.device_registry import DeviceInfo
|
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
|
|
|
from .const import DOMAIN, MANUFACTURER
|
|
from .coordinator import WeheatDataUpdateCoordinator
|
|
|
|
|
|
class WeheatEntity(CoordinatorEntity[WeheatDataUpdateCoordinator]):
|
|
"""Defines a base Weheat entity."""
|
|
|
|
_attr_has_entity_name = True
|
|
|
|
def __init__(
|
|
self,
|
|
coordinator: WeheatDataUpdateCoordinator,
|
|
) -> None:
|
|
"""Initialize the Weheat entity."""
|
|
super().__init__(coordinator)
|
|
|
|
self._attr_device_info = DeviceInfo(
|
|
identifiers={(DOMAIN, coordinator.heatpump_id)},
|
|
name=coordinator.readable_name,
|
|
manufacturer=MANUFACTURER,
|
|
model=coordinator.model,
|
|
)
|