mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Remove entity description mixin in Schlage (#112934)
This commit is contained in:
parent
e4b43680e1
commit
da40e83fd9
@ -20,25 +20,13 @@ from .coordinator import LockData, SchlageDataUpdateCoordinator
|
|||||||
from .entity import SchlageEntity
|
from .entity import SchlageEntity
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class SchlageBinarySensorEntityDescriptionMixin:
|
class SchlageBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Entity description for a Schlage binary_sensor."""
|
||||||
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
value_fn: Callable[[LockData], bool]
|
value_fn: Callable[[LockData], bool]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class SchlageBinarySensorEntityDescription(
|
|
||||||
BinarySensorEntityDescription, SchlageBinarySensorEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Entity description for a Schlage binary_sensor."""
|
|
||||||
|
|
||||||
|
|
||||||
_DESCRIPTIONS: tuple[SchlageBinarySensorEntityDescription] = (
|
_DESCRIPTIONS: tuple[SchlageBinarySensorEntityDescription] = (
|
||||||
SchlageBinarySensorEntityDescription(
|
SchlageBinarySensorEntityDescription(
|
||||||
key="keypad_disabled",
|
key="keypad_disabled",
|
||||||
|
@ -24,27 +24,15 @@ from .coordinator import SchlageDataUpdateCoordinator
|
|||||||
from .entity import SchlageEntity
|
from .entity import SchlageEntity
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class SchlageSwitchEntityDescriptionMixin:
|
class SchlageSwitchEntityDescription(SwitchEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Entity description for a Schlage switch."""
|
||||||
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
on_fn: Callable[[Lock], None]
|
on_fn: Callable[[Lock], None]
|
||||||
off_fn: Callable[[Lock], None]
|
off_fn: Callable[[Lock], None]
|
||||||
value_fn: Callable[[Lock], bool]
|
value_fn: Callable[[Lock], bool]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class SchlageSwitchEntityDescription(
|
|
||||||
SwitchEntityDescription, SchlageSwitchEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Entity description for a Schlage switch."""
|
|
||||||
|
|
||||||
|
|
||||||
SWITCHES: tuple[SchlageSwitchEntityDescription, ...] = (
|
SWITCHES: tuple[SchlageSwitchEntityDescription, ...] = (
|
||||||
SchlageSwitchEntityDescription(
|
SchlageSwitchEntityDescription(
|
||||||
key="beeper",
|
key="beeper",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user