Home Assistant Unofficial Reference
2024.12.1
entity.py
Go to the documentation of this file.
1
"""PermobilEntity class."""
2
3
from
homeassistant.helpers.device_registry
import
DeviceInfo
4
from
homeassistant.helpers.entity
import
EntityDescription
5
from
homeassistant.helpers.update_coordinator
import
CoordinatorEntity
6
7
from
.const
import
DOMAIN
8
from
.coordinator
import
MyPermobilCoordinator
9
10
11
class
PermobilEntity
(
CoordinatorEntity
[MyPermobilCoordinator]):
12
"""Representation of a permobil Entity."""
13
14
_attr_has_entity_name =
True
15
16
def
__init__
(
17
self,
18
coordinator: MyPermobilCoordinator,
19
description: EntityDescription,
20
) ->
None
:
21
"""Initialize the entity."""
22
super().
__init__
(coordinator)
23
self.
entity_description
entity_description = description
24
self.
_attr_unique_id
_attr_unique_id = f
"{coordinator.p_api.email}_{description.key}"
25
self.
_attr_device_info
_attr_device_info =
DeviceInfo
(
26
identifiers={(DOMAIN, coordinator.p_api.email)},
27
manufacturer=
"Permobil"
,
28
name=
"Permobil Wheelchair"
,
29
)
homeassistant.components.permobil.entity.PermobilEntity
Definition:
entity.py:11
homeassistant.components.permobil.entity.PermobilEntity._attr_device_info
_attr_device_info
Definition:
entity.py:25
homeassistant.components.permobil.entity.PermobilEntity.entity_description
entity_description
Definition:
entity.py:23
homeassistant.components.permobil.entity.PermobilEntity._attr_unique_id
_attr_unique_id
Definition:
entity.py:24
homeassistant.components.permobil.entity.PermobilEntity.__init__
None __init__(self, MyPermobilCoordinator coordinator, EntityDescription description)
Definition:
entity.py:20
homeassistant.helpers.device_registry.DeviceInfo
Definition:
device_registry.py:98
homeassistant.helpers.update_coordinator.CoordinatorEntity
Definition:
update_coordinator.py:568
homeassistant.helpers.device_registry
Definition:
device_registry.py:1
homeassistant.helpers.entity
Definition:
entity.py:1
homeassistant.helpers.update_coordinator
Definition:
update_coordinator.py:1
core
homeassistant
components
permobil
entity.py
Generated by
1.9.1