Remove entity description mixin in LaCrosse View (#112900)

This commit is contained in:
Joost Lekkerkerker 2024-03-10 19:54:11 +01:00 committed by GitHub
parent a85571c840
commit d531b6e9b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -36,20 +36,13 @@ from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
@dataclass(frozen=True)
class LaCrosseSensorEntityDescriptionMixin:
"""Mixin for required keys."""
@dataclass(frozen=True, kw_only=True)
class LaCrosseSensorEntityDescription(SensorEntityDescription):
"""Description for LaCrosse View sensor."""
value_fn: Callable[[Sensor, str], float | int | str | None]
@dataclass(frozen=True)
class LaCrosseSensorEntityDescription(
SensorEntityDescription, LaCrosseSensorEntityDescriptionMixin
):
"""Description for LaCrosse View sensor."""
def get_value(sensor: Sensor, field: str) -> float | int | str | None:
"""Get the value of a sensor field."""
field_data = sensor.data.get(field)