Home Assistant Unofficial Reference 2024.12.1
entity.py
Go to the documentation of this file.
1 """Support for OVO Energy."""
2 
3 from __future__ import annotations
4 
5 from ovoenergy import OVOEnergy
6 from ovoenergy.models import OVODailyUsage
7 
8 from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
10  CoordinatorEntity,
11  DataUpdateCoordinator,
12 )
13 
14 from .const import DOMAIN
15 
16 
17 class OVOEnergyEntity(CoordinatorEntity[DataUpdateCoordinator[OVODailyUsage]]):
18  """Defines a base OVO Energy entity."""
19 
20  _attr_has_entity_name = True
21 
22  def __init__(
23  self,
24  coordinator: DataUpdateCoordinator[OVODailyUsage],
25  client: OVOEnergy,
26  ) -> None:
27  """Initialize the OVO Energy entity."""
28  super().__init__(coordinator)
29  self._client_client = client
30 
31 
33  """Defines a OVO Energy device entity."""
34 
35  @property
36  def device_info(self) -> DeviceInfo:
37  """Return device information about this OVO Energy instance."""
38  return DeviceInfo(
39  entry_type=DeviceEntryType.SERVICE,
40  identifiers={(DOMAIN, self._client_client.account_id)},
41  manufacturer="OVO Energy",
42  name=self._client_client.username,
43  )
None __init__(self, DataUpdateCoordinator[OVODailyUsage] coordinator, OVOEnergy client)
Definition: entity.py:26