Home Assistant Unofficial Reference
2024.12.1
entity.py
Go to the documentation of this file.
1
"""Base class for Switcher entities."""
2
3
from
homeassistant.helpers
import
device_registry
as
dr
4
from
homeassistant.helpers.device_registry
import
DeviceInfo
5
from
homeassistant.helpers.update_coordinator
import
CoordinatorEntity
6
7
from
.coordinator
import
SwitcherDataUpdateCoordinator
8
9
10
class
SwitcherEntity
(
CoordinatorEntity
[SwitcherDataUpdateCoordinator]):
11
"""Base class for Switcher entities."""
12
13
_attr_has_entity_name =
True
14
15
def
__init__
(self, coordinator: SwitcherDataUpdateCoordinator) ->
None
:
16
"""Initialize the entity."""
17
super().
__init__
(coordinator)
18
self.
_attr_device_info
_attr_device_info =
DeviceInfo
(
19
connections={(dr.CONNECTION_NETWORK_MAC, coordinator.mac_address)}
20
)
homeassistant.components.switcher_kis.entity.SwitcherEntity
Definition:
entity.py:10
homeassistant.components.switcher_kis.entity.SwitcherEntity._attr_device_info
_attr_device_info
Definition:
entity.py:18
homeassistant.components.switcher_kis.entity.SwitcherEntity.__init__
None __init__(self, SwitcherDataUpdateCoordinator coordinator)
Definition:
entity.py:15
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.update_coordinator
Definition:
update_coordinator.py:1
homeassistant.helpers
Definition:
__init__.py:1
core
homeassistant
components
switcher_kis
entity.py
Generated by
1.9.1