Home Assistant Unofficial Reference 2024.12.1
entity.py
Go to the documentation of this file.
1 """Proxmox parent entity class."""
2 
4  CoordinatorEntity,
5  DataUpdateCoordinator,
6 )
7 
8 
10  """Represents any entity created for the Proxmox VE platform."""
11 
12  def __init__(
13  self,
14  coordinator: DataUpdateCoordinator,
15  unique_id: str,
16  name: str,
17  icon: str,
18  host_name: str,
19  node_name: str,
20  vm_id: int | None = None,
21  ) -> None:
22  """Initialize the Proxmox entity."""
23  super().__init__(coordinator)
24 
25  self.coordinatorcoordinator = coordinator
26  self._attr_unique_id_attr_unique_id = unique_id
27  self._attr_name_attr_name = name
28  self._host_name_host_name = host_name
29  self._attr_icon_attr_icon = icon
30  self._available_available = True
31  self._node_name_node_name = node_name
32  self._vm_id_vm_id = vm_id
33 
34  self._state_state = None
35 
36  @property
37  def available(self) -> bool:
38  """Return True if entity is available."""
39  return self.coordinatorcoordinator.last_update_success and self._available_available
None __init__(self, DataUpdateCoordinator coordinator, str unique_id, str name, str icon, str host_name, str node_name, int|None vm_id=None)
Definition: entity.py:21