Freeze integration entity descriptions (#105984)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
ae8db120e8
commit
0c2485bc03
462 changed files with 806 additions and 804 deletions
|
@ -32,14 +32,14 @@ from .util import cleanup_excluded_entity
|
|||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class ScreenLogicBinarySensorDescription(
|
||||
BinarySensorEntityDescription, ScreenLogicEntityDescription
|
||||
):
|
||||
"""A class that describes ScreenLogic binary sensor eneites."""
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class ScreenLogicPushBinarySensorDescription(
|
||||
ScreenLogicBinarySensorDescription, ScreenLogicPushEntityDescription
|
||||
):
|
||||
|
|
|
@ -68,7 +68,7 @@ async def async_setup_entry(
|
|||
async_add_entities(entities)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class ScreenLogicClimateDescription(
|
||||
ClimateEntityDescription, ScreenLogicPushEntityDescription
|
||||
):
|
||||
|
|
|
@ -28,14 +28,14 @@ from .util import generate_unique_id
|
|||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class ScreenLogicEntityRequiredKeyMixin:
|
||||
"""Mixin for required ScreenLogic entity data_path."""
|
||||
|
||||
data_root: ScreenLogicDataPath
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class ScreenLogicEntityDescription(
|
||||
EntityDescription, ScreenLogicEntityRequiredKeyMixin
|
||||
):
|
||||
|
@ -103,14 +103,14 @@ class ScreenlogicEntity(CoordinatorEntity[ScreenlogicDataUpdateCoordinator]):
|
|||
raise HomeAssistantError(f"Data not found: {self._data_path}") from ke
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class ScreenLogicPushEntityRequiredKeyMixin:
|
||||
"""Mixin for required key for ScreenLogic push entities."""
|
||||
|
||||
subscription_code: CODE
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class ScreenLogicPushEntityDescription(
|
||||
ScreenLogicEntityDescription,
|
||||
ScreenLogicPushEntityRequiredKeyMixin,
|
||||
|
|
|
@ -60,7 +60,7 @@ async def async_setup_entry(
|
|||
async_add_entities(entities)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class ScreenLogicLightDescription(
|
||||
LightEntityDescription, ScreenLogicPushEntityDescription
|
||||
):
|
||||
|
|
|
@ -29,14 +29,14 @@ _LOGGER = logging.getLogger(__name__)
|
|||
PARALLEL_UPDATES = 1
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class ScreenLogicNumberRequiredMixin:
|
||||
"""Describes a required mixin for a ScreenLogic number entity."""
|
||||
|
||||
set_value_name: str
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class ScreenLogicNumberDescription(
|
||||
NumberEntityDescription,
|
||||
ScreenLogicEntityDescription,
|
||||
|
|
|
@ -35,21 +35,21 @@ from .util import cleanup_excluded_entity, get_ha_unit
|
|||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class ScreenLogicSensorMixin:
|
||||
"""Mixin for SecreenLogic sensor entity."""
|
||||
|
||||
value_mod: Callable[[int | str], int | str] | None = None
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class ScreenLogicSensorDescription(
|
||||
ScreenLogicSensorMixin, SensorEntityDescription, ScreenLogicEntityDescription
|
||||
):
|
||||
"""Describes a ScreenLogic sensor."""
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class ScreenLogicPushSensorDescription(
|
||||
ScreenLogicSensorDescription, ScreenLogicPushEntityDescription
|
||||
):
|
||||
|
|
|
@ -56,7 +56,7 @@ async def async_setup_entry(
|
|||
async_add_entities(entities)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class ScreenLogicSwitchDescription(
|
||||
SwitchEntityDescription, ScreenLogicPushEntityDescription
|
||||
):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue