From 5f4881cb2807d5b466e9ad51925d29fcb2af045b Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Sun, 10 Mar 2024 18:16:18 +0100 Subject: [PATCH] Remove entity description mixin in Trafikverket Camera (#112954) --- .../components/trafikverket_camera/binary_sensor.py | 13 +++---------- .../components/trafikverket_camera/sensor.py | 13 +++---------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/homeassistant/components/trafikverket_camera/binary_sensor.py b/homeassistant/components/trafikverket_camera/binary_sensor.py index d1c7c7fbc0b370..56af099d54ba35 100644 --- a/homeassistant/components/trafikverket_camera/binary_sensor.py +++ b/homeassistant/components/trafikverket_camera/binary_sensor.py @@ -20,20 +20,13 @@ PARALLEL_UPDATES = 0 -@dataclass(frozen=True) -class DeviceBaseEntityDescriptionMixin: - """Mixin for required Trafikverket Camera base description keys.""" +@dataclass(frozen=True, kw_only=True) +class TVCameraSensorEntityDescription(BinarySensorEntityDescription): + """Describes Trafikverket Camera binary sensor entity.""" value_fn: Callable[[CameraData], bool | None] -@dataclass(frozen=True) -class TVCameraSensorEntityDescription( - BinarySensorEntityDescription, DeviceBaseEntityDescriptionMixin -): - """Describes Trafikverket Camera binary sensor entity.""" - - BINARY_SENSOR_TYPE = TVCameraSensorEntityDescription( key="active", translation_key="active", diff --git a/homeassistant/components/trafikverket_camera/sensor.py b/homeassistant/components/trafikverket_camera/sensor.py index 4cdc809c3382e0..f41eb1fa2a2a9d 100644 --- a/homeassistant/components/trafikverket_camera/sensor.py +++ b/homeassistant/components/trafikverket_camera/sensor.py @@ -24,20 +24,13 @@ PARALLEL_UPDATES = 0 -@dataclass(frozen=True) -class DeviceBaseEntityDescriptionMixin: - """Mixin for required Trafikverket Camera base description keys.""" +@dataclass(frozen=True, kw_only=True) +class TVCameraSensorEntityDescription(SensorEntityDescription): + """Describes Trafikverket Camera sensor entity.""" value_fn: Callable[[CameraData], StateType | datetime] -@dataclass(frozen=True) -class TVCameraSensorEntityDescription( - SensorEntityDescription, DeviceBaseEntityDescriptionMixin -): - """Describes Trafikverket Camera sensor entity.""" - - SENSOR_TYPES: tuple[TVCameraSensorEntityDescription, ...] = ( TVCameraSensorEntityDescription( key="direction",