From c6e9a3c36670887bf101e7ac59c61cadb601e97a Mon Sep 17 00:00:00 2001 From: Brett Adams Date: Sat, 16 Dec 2023 05:37:45 +0000 Subject: [PATCH 1/2] Add SensorEntityDescription flags --- homeassistant/components/tessie/binary_sensor.py | 2 ++ homeassistant/components/tessie/sensor.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/homeassistant/components/tessie/binary_sensor.py b/homeassistant/components/tessie/binary_sensor.py index ca78b19a42b2d1..15a68ca4173e73 100644 --- a/homeassistant/components/tessie/binary_sensor.py +++ b/homeassistant/components/tessie/binary_sensor.py @@ -24,6 +24,8 @@ class TessieBinarySensorEntityDescription(BinarySensorEntityDescription): """Describes Tessie binary sensor entity.""" is_on: Callable[..., bool] = lambda x: x + frozen = True + kw_only = True DESCRIPTIONS: tuple[TessieBinarySensorEntityDescription, ...] = ( diff --git a/homeassistant/components/tessie/sensor.py b/homeassistant/components/tessie/sensor.py index 2836b7e39317fd..f69c326da05812 100644 --- a/homeassistant/components/tessie/sensor.py +++ b/homeassistant/components/tessie/sensor.py @@ -37,6 +37,8 @@ class TessieSensorEntityDescription(SensorEntityDescription): """Describes Tessie Sensor entity.""" value_fn: Callable[[StateType], StateType] = lambda x: x + frozen = True + kw_only = True DESCRIPTIONS: tuple[TessieSensorEntityDescription, ...] = ( From 06c1c4142aaa0591893ead550c0c88a3c83107f6 Mon Sep 17 00:00:00 2001 From: Brett Adams Date: Sat, 16 Dec 2023 08:13:28 +0000 Subject: [PATCH 2/2] fix datclass attributes --- homeassistant/components/tessie/binary_sensor.py | 4 +--- homeassistant/components/tessie/sensor.py | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/tessie/binary_sensor.py b/homeassistant/components/tessie/binary_sensor.py index 15a68ca4173e73..fc00f9380e75d4 100644 --- a/homeassistant/components/tessie/binary_sensor.py +++ b/homeassistant/components/tessie/binary_sensor.py @@ -19,13 +19,11 @@ from .entity import TessieEntity -@dataclass +@dataclass(kw_only=True) class TessieBinarySensorEntityDescription(BinarySensorEntityDescription): """Describes Tessie binary sensor entity.""" is_on: Callable[..., bool] = lambda x: x - frozen = True - kw_only = True DESCRIPTIONS: tuple[TessieBinarySensorEntityDescription, ...] = ( diff --git a/homeassistant/components/tessie/sensor.py b/homeassistant/components/tessie/sensor.py index f69c326da05812..91fb3782acd1b1 100644 --- a/homeassistant/components/tessie/sensor.py +++ b/homeassistant/components/tessie/sensor.py @@ -32,13 +32,11 @@ from .entity import TessieEntity -@dataclass +@dataclass(kw_only=True) class TessieSensorEntityDescription(SensorEntityDescription): """Describes Tessie Sensor entity.""" value_fn: Callable[[StateType], StateType] = lambda x: x - frozen = True - kw_only = True DESCRIPTIONS: tuple[TessieSensorEntityDescription, ...] = (