From 32fbbb42bd130e1bc5f977c93b1bdb302dfb8247 Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Thu, 16 Nov 2023 13:05:25 +0100 Subject: [PATCH] Use kw_only in entity description example (#1979) --- docs/core/entity.md | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/docs/core/entity.md b/docs/core/entity.md index 565fdf82..e22983cf 100644 --- a/docs/core/entity.md +++ b/docs/core/entity.md @@ -270,20 +270,13 @@ from homeassistant.helpers.typing import StateType from .const import DOMAIN, LOGGER -@dataclass -class ExampleSensorEntityDescriptionMixin: - """Mixin for required keys.""" - value_fn: Callable[[ExampleDevice], StateType] - - -@dataclass -class ExampleSensorEntityDescription( - SensorEntityDescription, ExampleSensorEntityDescriptionMixin -): +@dataclass(kw_only=True) +class ExampleSensorEntityDescription(SensorEntityDescription): """Describes Example sensor entity.""" exists_fn: Callable[[ExampleDevice], bool] = lambda _: True + value_fn: Callable[[ExampleDevice], StateType] SENSORS: tuple[ExampleSensorEntityDescription, ...] = (