diff --git a/homeassistant/components/screenlogic/binary_sensor.py b/homeassistant/components/screenlogic/binary_sensor.py index ac3fce80102..6f956026c11 100644 --- a/homeassistant/components/screenlogic/binary_sensor.py +++ b/homeassistant/components/screenlogic/binary_sensor.py @@ -33,14 +33,14 @@ from .util import cleanup_excluded_entity _LOGGER = logging.getLogger(__name__) -@dataclasses.dataclass(frozen=True) +@dataclasses.dataclass(frozen=True, kw_only=True) class ScreenLogicBinarySensorDescription( BinarySensorEntityDescription, ScreenLogicEntityDescription ): """A class that describes ScreenLogic binary sensor eneites.""" -@dataclasses.dataclass(frozen=True) +@dataclasses.dataclass(frozen=True, kw_only=True) class ScreenLogicPushBinarySensorDescription( ScreenLogicBinarySensorDescription, ScreenLogicPushEntityDescription ): diff --git a/homeassistant/components/screenlogic/climate.py b/homeassistant/components/screenlogic/climate.py index b3b83a66935..e0e61e826b0 100644 --- a/homeassistant/components/screenlogic/climate.py +++ b/homeassistant/components/screenlogic/climate.py @@ -69,7 +69,7 @@ async def async_setup_entry( async_add_entities(entities) -@dataclass(frozen=True) +@dataclass(frozen=True, kw_only=True) class ScreenLogicClimateDescription( ClimateEntityDescription, ScreenLogicPushEntityDescription ): diff --git a/homeassistant/components/screenlogic/entity.py b/homeassistant/components/screenlogic/entity.py index 6d898ec825d..df7fe6fc265 100644 --- a/homeassistant/components/screenlogic/entity.py +++ b/homeassistant/components/screenlogic/entity.py @@ -29,19 +29,11 @@ from .util import generate_unique_id _LOGGER = logging.getLogger(__name__) -@dataclass(frozen=True) -class ScreenLogicEntityRequiredKeyMixin: - """Mixin for required ScreenLogic entity data_path.""" - - data_root: ScreenLogicDataPath - - -@dataclass(frozen=True) -class ScreenLogicEntityDescription( - EntityDescription, ScreenLogicEntityRequiredKeyMixin -): +@dataclass(frozen=True, kw_only=True) +class ScreenLogicEntityDescription(EntityDescription): """Base class for a ScreenLogic entity description.""" + data_root: ScreenLogicDataPath enabled_lambda: Callable[..., bool] | None = None @@ -104,21 +96,13 @@ class ScreenLogicEntity(CoordinatorEntity[ScreenlogicDataUpdateCoordinator]): raise HomeAssistantError(f"Data not found: {self._data_path}") from ke -@dataclass(frozen=True) -class ScreenLogicPushEntityRequiredKeyMixin: - """Mixin for required key for ScreenLogic push entities.""" +@dataclass(frozen=True, kw_only=True) +class ScreenLogicPushEntityDescription(ScreenLogicEntityDescription): + """Base class for a ScreenLogic push entity description.""" subscription_code: CODE -@dataclass(frozen=True) -class ScreenLogicPushEntityDescription( - ScreenLogicEntityDescription, - ScreenLogicPushEntityRequiredKeyMixin, -): - """Base class for a ScreenLogic push entity description.""" - - class ScreenLogicPushEntity(ScreenLogicEntity): """Base class for all ScreenLogic push entities.""" diff --git a/homeassistant/components/screenlogic/light.py b/homeassistant/components/screenlogic/light.py index 19f27a73115..4def432d97c 100644 --- a/homeassistant/components/screenlogic/light.py +++ b/homeassistant/components/screenlogic/light.py @@ -61,7 +61,7 @@ async def async_setup_entry( async_add_entities(entities) -@dataclass(frozen=True) +@dataclass(frozen=True, kw_only=True) class ScreenLogicLightDescription( LightEntityDescription, ScreenLogicPushEntityDescription ): diff --git a/homeassistant/components/screenlogic/number.py b/homeassistant/components/screenlogic/number.py index d3e433b60e0..71d4e045da6 100644 --- a/homeassistant/components/screenlogic/number.py +++ b/homeassistant/components/screenlogic/number.py @@ -28,7 +28,7 @@ _LOGGER = logging.getLogger(__name__) PARALLEL_UPDATES = 1 -@dataclass(frozen=True) +@dataclass(frozen=True, kw_only=True) class ScreenLogicNumberDescription( NumberEntityDescription, ScreenLogicEntityDescription, diff --git a/homeassistant/components/screenlogic/sensor.py b/homeassistant/components/screenlogic/sensor.py index 9fe201ba6bb..a67c61c4c91 100644 --- a/homeassistant/components/screenlogic/sensor.py +++ b/homeassistant/components/screenlogic/sensor.py @@ -36,21 +36,16 @@ from .util import cleanup_excluded_entity, get_ha_unit _LOGGER = logging.getLogger(__name__) -@dataclasses.dataclass(frozen=True) -class ScreenLogicSensorMixin: - """Mixin for SecreenLogic sensor entity.""" +@dataclasses.dataclass(frozen=True, kw_only=True) +class ScreenLogicSensorDescription( + SensorEntityDescription, ScreenLogicEntityDescription +): + """Describes a ScreenLogic sensor.""" value_mod: Callable[[int | str], int | str] | None = None -@dataclasses.dataclass(frozen=True) -class ScreenLogicSensorDescription( - ScreenLogicSensorMixin, SensorEntityDescription, ScreenLogicEntityDescription -): - """Describes a ScreenLogic sensor.""" - - -@dataclasses.dataclass(frozen=True) +@dataclasses.dataclass(frozen=True, kw_only=True) class ScreenLogicPushSensorDescription( ScreenLogicSensorDescription, ScreenLogicPushEntityDescription ): diff --git a/homeassistant/components/screenlogic/switch.py b/homeassistant/components/screenlogic/switch.py index f97106fa7bc..fe697567bab 100644 --- a/homeassistant/components/screenlogic/switch.py +++ b/homeassistant/components/screenlogic/switch.py @@ -23,7 +23,7 @@ from .entity import ( _LOGGER = logging.getLogger(__name__) -@dataclass(frozen=True) +@dataclass(frozen=True, kw_only=True) class ScreenLogicCircuitSwitchDescription( SwitchEntityDescription, ScreenLogicPushEntityDescription ):