mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 00:37:13 +00:00
Remove entity description mixin in Kostal Plenticore (#112898)
This commit is contained in:
parent
d82ffb4e07
commit
067c222bd9
@ -27,9 +27,9 @@ from .helper import PlenticoreDataFormatter, SettingDataUpdateCoordinator
|
|||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class PlenticoreNumberEntityDescriptionMixin:
|
class PlenticoreNumberEntityDescription(NumberEntityDescription):
|
||||||
"""Define an entity description mixin for number entities."""
|
"""Describes a Plenticore number entity."""
|
||||||
|
|
||||||
module_id: str
|
module_id: str
|
||||||
data_id: str
|
data_id: str
|
||||||
@ -37,13 +37,6 @@ class PlenticoreNumberEntityDescriptionMixin:
|
|||||||
fmt_to: str
|
fmt_to: str
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class PlenticoreNumberEntityDescription(
|
|
||||||
NumberEntityDescription, PlenticoreNumberEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Describes a Plenticore number entity."""
|
|
||||||
|
|
||||||
|
|
||||||
NUMBER_SETTINGS_DATA = [
|
NUMBER_SETTINGS_DATA = [
|
||||||
PlenticoreNumberEntityDescription(
|
PlenticoreNumberEntityDescription(
|
||||||
key="battery_min_soc",
|
key="battery_min_soc",
|
||||||
|
@ -20,20 +20,13 @@ from .helper import Plenticore, SelectDataUpdateCoordinator
|
|||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class PlenticoreRequiredKeysMixin:
|
class PlenticoreSelectEntityDescription(SelectEntityDescription):
|
||||||
"""A class that describes required properties for plenticore select entities."""
|
"""A class that describes plenticore select entities."""
|
||||||
|
|
||||||
module_id: str
|
module_id: str
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class PlenticoreSelectEntityDescription(
|
|
||||||
SelectEntityDescription, PlenticoreRequiredKeysMixin
|
|
||||||
):
|
|
||||||
"""A class that describes plenticore select entities."""
|
|
||||||
|
|
||||||
|
|
||||||
SELECT_SETTINGS_DATA = [
|
SELECT_SETTINGS_DATA = [
|
||||||
PlenticoreSelectEntityDescription(
|
PlenticoreSelectEntityDescription(
|
||||||
module_id="devices:local",
|
module_id="devices:local",
|
||||||
|
@ -34,21 +34,14 @@ from .helper import PlenticoreDataFormatter, ProcessDataUpdateCoordinator
|
|||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class PlenticoreRequiredKeysMixin:
|
class PlenticoreSensorEntityDescription(SensorEntityDescription):
|
||||||
"""A class that describes required properties for plenticore sensor entities."""
|
"""A class that describes plenticore sensor entities."""
|
||||||
|
|
||||||
module_id: str
|
module_id: str
|
||||||
formatter: str
|
formatter: str
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class PlenticoreSensorEntityDescription(
|
|
||||||
SensorEntityDescription, PlenticoreRequiredKeysMixin
|
|
||||||
):
|
|
||||||
"""A class that describes plenticore sensor entities."""
|
|
||||||
|
|
||||||
|
|
||||||
SENSOR_PROCESS_DATA = [
|
SENSOR_PROCESS_DATA = [
|
||||||
PlenticoreSensorEntityDescription(
|
PlenticoreSensorEntityDescription(
|
||||||
module_id="devices:local",
|
module_id="devices:local",
|
||||||
|
@ -21,9 +21,9 @@ from .helper import SettingDataUpdateCoordinator
|
|||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class PlenticoreRequiredKeysMixin:
|
class PlenticoreSwitchEntityDescription(SwitchEntityDescription):
|
||||||
"""A class that describes required properties for plenticore switch entities."""
|
"""A class that describes plenticore switch entities."""
|
||||||
|
|
||||||
module_id: str
|
module_id: str
|
||||||
is_on: str
|
is_on: str
|
||||||
@ -33,13 +33,6 @@ class PlenticoreRequiredKeysMixin:
|
|||||||
off_label: str
|
off_label: str
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class PlenticoreSwitchEntityDescription(
|
|
||||||
SwitchEntityDescription, PlenticoreRequiredKeysMixin
|
|
||||||
):
|
|
||||||
"""A class that describes plenticore switch entities."""
|
|
||||||
|
|
||||||
|
|
||||||
SWITCH_SETTINGS_DATA = [
|
SWITCH_SETTINGS_DATA = [
|
||||||
PlenticoreSwitchEntityDescription(
|
PlenticoreSwitchEntityDescription(
|
||||||
module_id="devices:local",
|
module_id="devices:local",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user