mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Remove unnecessary Notion entity description mixins (#108194)
This commit is contained in:
parent
0a9ec1a351
commit
70aff728fd
@ -30,24 +30,17 @@ from .const import (
|
|||||||
SENSOR_SMOKE_CO,
|
SENSOR_SMOKE_CO,
|
||||||
SENSOR_WINDOW_HINGED,
|
SENSOR_WINDOW_HINGED,
|
||||||
)
|
)
|
||||||
from .model import NotionEntityDescriptionMixin
|
from .model import NotionEntityDescription
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class NotionBinarySensorDescriptionMixin:
|
|
||||||
"""Define an entity description mixin for binary and regular sensors."""
|
|
||||||
|
|
||||||
on_state: Literal["alarm", "leak", "low", "not_missing", "open"]
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class NotionBinarySensorDescription(
|
class NotionBinarySensorDescription(
|
||||||
BinarySensorEntityDescription,
|
BinarySensorEntityDescription, NotionEntityDescription
|
||||||
NotionBinarySensorDescriptionMixin,
|
|
||||||
NotionEntityDescriptionMixin,
|
|
||||||
):
|
):
|
||||||
"""Describe a Notion binary sensor."""
|
"""Describe a Notion binary sensor."""
|
||||||
|
|
||||||
|
on_state: Literal["alarm", "leak", "low", "not_missing", "open"]
|
||||||
|
|
||||||
|
|
||||||
BINARY_SENSOR_DESCRIPTIONS = (
|
BINARY_SENSOR_DESCRIPTIONS = (
|
||||||
NotionBinarySensorDescription(
|
NotionBinarySensorDescription(
|
||||||
|
@ -4,8 +4,8 @@ from dataclasses import dataclass
|
|||||||
from aionotion.sensor.models import ListenerKind
|
from aionotion.sensor.models import ListenerKind
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class NotionEntityDescriptionMixin:
|
class NotionEntityDescription:
|
||||||
"""Define an description mixin Notion entities."""
|
"""Define an description for Notion entities."""
|
||||||
|
|
||||||
listener_kind: ListenerKind
|
listener_kind: ListenerKind
|
||||||
|
@ -16,11 +16,11 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
|||||||
|
|
||||||
from . import NotionEntity
|
from . import NotionEntity
|
||||||
from .const import DOMAIN, SENSOR_MOLD, SENSOR_TEMPERATURE
|
from .const import DOMAIN, SENSOR_MOLD, SENSOR_TEMPERATURE
|
||||||
from .model import NotionEntityDescriptionMixin
|
from .model import NotionEntityDescription
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class NotionSensorDescription(SensorEntityDescription, NotionEntityDescriptionMixin):
|
class NotionSensorDescription(SensorEntityDescription, NotionEntityDescription):
|
||||||
"""Describe a Notion sensor."""
|
"""Describe a Notion sensor."""
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user