Remove entity description mixin in Tolo (#112951)

pull/111502/head
Joost Lekkerkerker 2024-03-11 11:55:33 +01:00 committed by GitHub
parent d723d5815c
commit 276b8147d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 20 deletions

View File

@ -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

View File

@ -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