diff --git a/homeassistant/components/schlage/binary_sensor.py b/homeassistant/components/schlage/binary_sensor.py index 5c97a903c72..fae6208b95f 100644 --- a/homeassistant/components/schlage/binary_sensor.py +++ b/homeassistant/components/schlage/binary_sensor.py @@ -20,25 +20,13 @@ from .coordinator import LockData, SchlageDataUpdateCoordinator from .entity import SchlageEntity -@dataclass(frozen=True) -class SchlageBinarySensorEntityDescriptionMixin: - """Mixin for required keys.""" - - # NOTE: This has to be a mixin because these are required keys. - # BinarySensorEntityDescription has attributes with default values, - # which means we can't inherit from it because you haven't have - # non-default arguments follow default arguments in an initializer. +@dataclass(frozen=True, kw_only=True) +class SchlageBinarySensorEntityDescription(BinarySensorEntityDescription): + """Entity description for a Schlage binary_sensor.""" value_fn: Callable[[LockData], bool] -@dataclass(frozen=True) -class SchlageBinarySensorEntityDescription( - BinarySensorEntityDescription, SchlageBinarySensorEntityDescriptionMixin -): - """Entity description for a Schlage binary_sensor.""" - - _DESCRIPTIONS: tuple[SchlageBinarySensorEntityDescription] = ( SchlageBinarySensorEntityDescription( key="keypad_disabled", diff --git a/homeassistant/components/schlage/switch.py b/homeassistant/components/schlage/switch.py index 36c8fa74244..467fbc671bf 100644 --- a/homeassistant/components/schlage/switch.py +++ b/homeassistant/components/schlage/switch.py @@ -24,27 +24,15 @@ from .coordinator import SchlageDataUpdateCoordinator from .entity import SchlageEntity -@dataclass(frozen=True) -class SchlageSwitchEntityDescriptionMixin: - """Mixin for required keys.""" - - # NOTE: This has to be a mixin because these are required keys. - # SwitchEntityDescription has attributes with default values, - # which means we can't inherit from it because you haven't have - # non-default arguments follow default arguments in an initializer. +@dataclass(frozen=True, kw_only=True) +class SchlageSwitchEntityDescription(SwitchEntityDescription): + """Entity description for a Schlage switch.""" on_fn: Callable[[Lock], None] off_fn: Callable[[Lock], None] value_fn: Callable[[Lock], bool] -@dataclass(frozen=True) -class SchlageSwitchEntityDescription( - SwitchEntityDescription, SchlageSwitchEntityDescriptionMixin -): - """Entity description for a Schlage switch.""" - - SWITCHES: tuple[SchlageSwitchEntityDescription, ...] = ( SchlageSwitchEntityDescription( key="beeper",