From 23ac3248e620469f3157b18c13cb27c3815368c2 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Wed, 15 Nov 2023 12:03:15 +0100 Subject: [PATCH] Remove Discovergy entity description required fields mixin (#104028) --- homeassistant/components/discovergy/sensor.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/discovergy/sensor.py b/homeassistant/components/discovergy/sensor.py index 0f5ace28dd7..c0c610fa98a 100644 --- a/homeassistant/components/discovergy/sensor.py +++ b/homeassistant/components/discovergy/sensor.py @@ -30,9 +30,9 @@ from .const import DOMAIN, MANUFACTURER PARALLEL_UPDATES = 1 -@dataclass -class DiscovergyMixin: - """Mixin for alternative keys.""" +@dataclass(kw_only=True) +class DiscovergySensorEntityDescription(SensorEntityDescription): + """Class to describe a Discovergy sensor entity.""" value_fn: Callable[[Reading, str, int], datetime | float | None] = field( default=lambda reading, key, scale: float(reading.values[key] / scale) @@ -41,11 +41,6 @@ class DiscovergyMixin: scale: int = field(default_factory=lambda: 1000) -@dataclass -class DiscovergySensorEntityDescription(DiscovergyMixin, SensorEntityDescription): - """Define Sensor entity description class.""" - - GAS_SENSORS: tuple[DiscovergySensorEntityDescription, ...] = ( DiscovergySensorEntityDescription( key="volume",