mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Remove entity description mixin in Dremel 3D Printer (#112405)
This commit is contained in:
parent
86503526ee
commit
5400b4055a
@ -19,20 +19,13 @@ from .const import DOMAIN
|
||||
from .entity import Dremel3DPrinterEntity
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Dremel3DPrinterBinarySensorEntityMixin:
|
||||
"""Mixin for Dremel 3D Printer binary sensor."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class Dremel3DPrinterBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||
"""Describes a Dremel 3D Printer binary sensor."""
|
||||
|
||||
value_fn: Callable[[Dremel3DPrinter], bool]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Dremel3DPrinterBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, Dremel3DPrinterBinarySensorEntityMixin
|
||||
):
|
||||
"""Describes a Dremel 3D Printer binary sensor."""
|
||||
|
||||
|
||||
BINARY_SENSOR_TYPES: tuple[Dremel3DPrinterBinarySensorEntityDescription, ...] = (
|
||||
Dremel3DPrinterBinarySensorEntityDescription(
|
||||
key="door",
|
||||
|
@ -16,20 +16,13 @@ from .const import DOMAIN
|
||||
from .entity import Dremel3DPrinterEntity
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Dremel3DPrinterButtonEntityMixin:
|
||||
"""Mixin for required keys."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class Dremel3DPrinterButtonEntityDescription(ButtonEntityDescription):
|
||||
"""Describes a Dremel 3D Printer button entity."""
|
||||
|
||||
press_fn: Callable[[Dremel3DPrinter], None]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Dremel3DPrinterButtonEntityDescription(
|
||||
ButtonEntityDescription, Dremel3DPrinterButtonEntityMixin
|
||||
):
|
||||
"""Describes a Dremel 3D Printer button entity."""
|
||||
|
||||
|
||||
BUTTON_TYPES: tuple[Dremel3DPrinterButtonEntityDescription, ...] = (
|
||||
Dremel3DPrinterButtonEntityDescription(
|
||||
key="cancel_job",
|
||||
|
@ -31,19 +31,11 @@ from .const import ATTR_EXTRUDER, ATTR_PLATFORM, DOMAIN
|
||||
from .entity import Dremel3DPrinterEntity
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Dremel3DPrinterSensorEntityMixin:
|
||||
"""Mixin for Dremel 3D Printer sensor."""
|
||||
|
||||
value_fn: Callable[[Dremel3DPrinter, str], StateType | datetime]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Dremel3DPrinterSensorEntityDescription(
|
||||
SensorEntityDescription, Dremel3DPrinterSensorEntityMixin
|
||||
):
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class Dremel3DPrinterSensorEntityDescription(SensorEntityDescription):
|
||||
"""Describes a Dremel 3D Printer sensor."""
|
||||
|
||||
value_fn: Callable[[Dremel3DPrinter, str], StateType | datetime]
|
||||
available_fn: Callable[[Dremel3DPrinter, str], bool] = lambda api, _: True
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user