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
|
from .const import DOMAIN, FAN_TIMER_MAX, POWER_TIMER_MAX, SALT_BATH_TIMER_MAX
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class ToloNumberEntityDescriptionBase:
|
class ToloNumberEntityDescription(NumberEntityDescription):
|
||||||
"""Required values when describing TOLO Number entities."""
|
"""Class describing TOLO Number entities."""
|
||||||
|
|
||||||
getter: Callable[[SettingsInfo], int | None]
|
getter: Callable[[SettingsInfo], int | None]
|
||||||
setter: Callable[[ToloClient, int | None], Any]
|
setter: Callable[[ToloClient, int | None], Any]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class ToloNumberEntityDescription(
|
|
||||||
NumberEntityDescription, ToloNumberEntityDescriptionBase
|
|
||||||
):
|
|
||||||
"""Class describing TOLO Number entities."""
|
|
||||||
|
|
||||||
entity_category = EntityCategory.CONFIG
|
entity_category = EntityCategory.CONFIG
|
||||||
native_min_value = 0
|
native_min_value = 0
|
||||||
native_step = 1
|
native_step = 1
|
||||||
|
|
|
@ -27,20 +27,13 @@ from . import ToloSaunaCoordinatorEntity, ToloSaunaUpdateCoordinator
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class ToloSensorEntityDescriptionBase:
|
class ToloSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Required values when describing TOLO Sensor entities."""
|
"""Class describing TOLO Sensor entities."""
|
||||||
|
|
||||||
getter: Callable[[StatusInfo], int | None]
|
getter: Callable[[StatusInfo], int | None]
|
||||||
availability_checker: Callable[[SettingsInfo, StatusInfo], bool] | None
|
availability_checker: Callable[[SettingsInfo, StatusInfo], bool] | None
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class ToloSensorEntityDescription(
|
|
||||||
SensorEntityDescription, ToloSensorEntityDescriptionBase
|
|
||||||
):
|
|
||||||
"""Class describing TOLO Sensor entities."""
|
|
||||||
|
|
||||||
state_class = SensorStateClass.MEASUREMENT
|
state_class = SensorStateClass.MEASUREMENT
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue