Home Assistant Unofficial Reference
2024.12.1
entity.py
Go to the documentation of this file.
1
"""Base Entity for Zeversolar sensors."""
2
3
from
__future__
import
annotations
4
5
from
homeassistant.helpers.device_registry
import
DeviceInfo
6
from
homeassistant.helpers.update_coordinator
import
CoordinatorEntity
7
8
from
.const
import
DOMAIN
9
from
.coordinator
import
ZeversolarCoordinator
10
11
12
class
ZeversolarEntity
(
13
CoordinatorEntity[ZeversolarCoordinator],
14
):
15
"""Defines a base Zeversolar entity."""
16
17
_attr_has_entity_name =
True
18
19
def
__init__
(
20
self,
21
*,
22
coordinator: ZeversolarCoordinator,
23
) ->
None
:
24
"""Initialize the Zeversolar entity."""
25
super().
__init__
(coordinator=coordinator)
26
self.
_attr_device_info
_attr_device_info =
DeviceInfo
(
27
identifiers={(DOMAIN, coordinator.data.serial_number)},
28
name=
"Zeversolar Sensor"
,
29
manufacturer=
"Zeversolar"
,
30
)
homeassistant.components.zeversolar.entity.ZeversolarEntity
Definition:
entity.py:14
homeassistant.components.zeversolar.entity.ZeversolarEntity.__init__
None __init__(self, *ZeversolarCoordinator coordinator)
Definition:
entity.py:23
homeassistant.components.zeversolar.entity.ZeversolarEntity._attr_device_info
_attr_device_info
Definition:
entity.py:26
homeassistant.helpers.device_registry.DeviceInfo
Definition:
device_registry.py:98
homeassistant.helpers.device_registry
Definition:
device_registry.py:1
homeassistant.helpers.update_coordinator
Definition:
update_coordinator.py:1
core
homeassistant
components
zeversolar
entity.py
Generated by
1.9.1