-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path__init__.py
More file actions
33 lines (25 loc) · 1.14 KB
/
__init__.py
File metadata and controls
33 lines (25 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""Fan platform for ha_integration_domain."""
from __future__ import annotations
from typing import TYPE_CHECKING
from custom_components.ha_integration_domain.const import PARALLEL_UPDATES as PARALLEL_UPDATES
from homeassistant.components.fan import FanEntityDescription
from .air_purifier_fan import ENTITY_DESCRIPTIONS as FAN_DESCRIPTIONS, IntegrationBlueprintFan
if TYPE_CHECKING:
from custom_components.ha_integration_domain.data import IntegrationBlueprintConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
# Combine all entity descriptions from different modules
ENTITY_DESCRIPTIONS: tuple[FanEntityDescription, ...] = (*FAN_DESCRIPTIONS,)
async def async_setup_entry(
hass: HomeAssistant,
entry: IntegrationBlueprintConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the fan platform."""
async_add_entities(
IntegrationBlueprintFan(
coordinator=entry.runtime_data.coordinator,
entity_description=entity_description,
)
for entity_description in ENTITY_DESCRIPTIONS
)