Files
ha-probe/custom_components/ha_probe/const.py
T
2026-11-01 18:33:58 +01:00

31 lines
813 B
Python

"""Constants for the HA Probe integration."""
from __future__ import annotations
from dataclasses import dataclass, field
from typing import TYPE_CHECKING
from homeassistant.const import Platform
if TYPE_CHECKING:
from .sensor import HaProbeSensor
DOMAIN = "ha_probe"
PLATFORMS: list[Platform] = [Platform.SENSOR]
CONF_WEBHOOK_ID = "webhook_id"
def signal_entities(entry_id: str) -> str:
"""Return the dispatcher signal used to deliver a webhook payload's entities."""
return f"{DOMAIN}_{entry_id}_entities"
@dataclass
class HaProbeRuntimeData:
"""Runtime state for a configured probe webhook, kept on ConfigEntry.runtime_data."""
webhook_url: str = ""
devices: dict[str, str] = field(default_factory=dict)
entities: dict[str, "HaProbeSensor"] = field(default_factory=dict)