Remove entity description mixin in Tolo (#112951)
parent
d723d5815c
commit
276b8147d3
|
@ -19,20 +19,13 @@ from . import ToloSaunaCoordinatorEntity, ToloSaunaUpdateCoordinator
|
|||
from .const import DOMAIN, FAN_TIMER_MAX, POWER_TIMER_MAX, SALT_BATH_TIMER_MAX
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ToloNumberEntityDescriptionBase:
|
||||
"""Required values when describing TOLO Number entities."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class ToloNumberEntityDescription(NumberEntityDescription):
|
||||
"""Class describing TOLO Number entities."""
|
||||
|
||||
getter: Callable[[SettingsInfo], int | None]
|
||||
setter: Callable[[ToloClient, int | None], Any]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ToloNumberEntityDescription(
|
||||
NumberEntityDescription, ToloNumberEntityDescriptionBase
|
||||
):
|
||||
"""Class describing TOLO Number entities."""
|
||||
|
||||
entity_category = EntityCategory.CONFIG
|
||||
native_min_value = 0
|
||||
native_step = 1
|
||||
|
|
|
@ -27,20 +27,13 @@ from . import ToloSaunaCoordinatorEntity, ToloSaunaUpdateCoordinator
|
|||
from .const import DOMAIN
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ToloSensorEntityDescriptionBase:
|
||||
"""Required values when describing TOLO Sensor entities."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class ToloSensorEntityDescription(SensorEntityDescription):
|
||||
"""Class describing TOLO Sensor entities."""
|
||||
|
||||
getter: Callable[[StatusInfo], int | None]
|
||||
availability_checker: Callable[[SettingsInfo, StatusInfo], bool] | None
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ToloSensorEntityDescription(
|
||||
SensorEntityDescription, ToloSensorEntityDescriptionBase
|
||||
):
|
||||
"""Class describing TOLO Sensor entities."""
|
||||
|
||||
state_class = SensorStateClass.MEASUREMENT
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue