Freeze integration entity descriptions (#105984)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Erik Montnemery 2023-12-19 03:28:13 +01:00 committed by GitHub
parent ae8db120e8
commit 0c2485bc03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
462 changed files with 806 additions and 804 deletions

View file

@ -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
):

View file

@ -68,7 +68,7 @@ async def async_setup_entry(
async_add_entities(entities)
@dataclass
@dataclass(frozen=True)
class ScreenLogicClimateDescription(
ClimateEntityDescription, ScreenLogicPushEntityDescription
):

View file

@ -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,

View file

@ -60,7 +60,7 @@ async def async_setup_entry(
async_add_entities(entities)
@dataclass
@dataclass(frozen=True)
class ScreenLogicLightDescription(
LightEntityDescription, ScreenLogicPushEntityDescription
):

View file

@ -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,

View file

@ -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
):

View file

@ -56,7 +56,7 @@ async def async_setup_entry(
async_add_entities(entities)
@dataclass
@dataclass(frozen=True)
class ScreenLogicSwitchDescription(
SwitchEntityDescription, ScreenLogicPushEntityDescription
):