mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Remove entity description mixin in August (#112383)
This commit is contained in:
parent
8cd98a5319
commit
8440b57349
@ -105,27 +105,15 @@ def _native_datetime() -> datetime:
|
|||||||
return datetime.now()
|
return datetime.now()
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class AugustBinarySensorEntityDescription(BinarySensorEntityDescription):
|
class AugustDoorbellBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||||
"""Describes August binary_sensor entity."""
|
"""Describes August binary_sensor entity."""
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class AugustDoorbellRequiredKeysMixin:
|
|
||||||
"""Mixin for required keys."""
|
|
||||||
|
|
||||||
value_fn: Callable[[AugustData, DoorbellDetail], bool]
|
value_fn: Callable[[AugustData, DoorbellDetail], bool]
|
||||||
is_time_based: bool
|
is_time_based: bool
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
SENSOR_TYPE_DOOR = BinarySensorEntityDescription(
|
||||||
class AugustDoorbellBinarySensorEntityDescription(
|
|
||||||
BinarySensorEntityDescription, AugustDoorbellRequiredKeysMixin
|
|
||||||
):
|
|
||||||
"""Describes August binary_sensor entity."""
|
|
||||||
|
|
||||||
|
|
||||||
SENSOR_TYPE_DOOR = AugustBinarySensorEntityDescription(
|
|
||||||
key="open",
|
key="open",
|
||||||
device_class=BinarySensorDeviceClass.DOOR,
|
device_class=BinarySensorDeviceClass.DOOR,
|
||||||
)
|
)
|
||||||
@ -217,7 +205,7 @@ class AugustDoorBinarySensor(AugustEntityMixin, BinarySensorEntity):
|
|||||||
self,
|
self,
|
||||||
data: AugustData,
|
data: AugustData,
|
||||||
device: Lock,
|
device: Lock,
|
||||||
description: AugustBinarySensorEntityDescription,
|
description: BinarySensorEntityDescription,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the sensor."""
|
"""Initialize the sensor."""
|
||||||
super().__init__(data, device)
|
super().__init__(data, device)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user