mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +00:00
Freeze integration entity descriptions (#105984)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
ae8db120e8
commit
0c2485bc03
@ -27,7 +27,7 @@ ABODE_TEMPERATURE_UNIT_HA_UNIT = {
|
||||
}
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AbodeSensorDescriptionMixin:
|
||||
"""Mixin for Abode sensor."""
|
||||
|
||||
@ -35,7 +35,7 @@ class AbodeSensorDescriptionMixin:
|
||||
native_unit_of_measurement_fn: Callable[[AbodeSense], str]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AbodeSensorDescription(SensorEntityDescription, AbodeSensorDescriptionMixin):
|
||||
"""Class describing Abode sensor entities."""
|
||||
|
||||
|
@ -45,14 +45,14 @@ from .const import (
|
||||
PARALLEL_UPDATES = 1
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AccuWeatherSensorDescriptionMixin:
|
||||
"""Mixin for AccuWeather sensor."""
|
||||
|
||||
value_fn: Callable[[dict[str, Any]], str | int | float | None]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AccuWeatherSensorDescription(
|
||||
SensorEntityDescription, AccuWeatherSensorDescriptionMixin
|
||||
):
|
||||
|
@ -22,7 +22,7 @@ SCAN_INTERVAL = timedelta(seconds=300)
|
||||
PARALLEL_UPDATES = 4
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class AdGuardHomeEntityDescription(SensorEntityDescription):
|
||||
"""Describes AdGuard Home sensor entity."""
|
||||
|
||||
|
@ -21,7 +21,7 @@ SCAN_INTERVAL = timedelta(seconds=10)
|
||||
PARALLEL_UPDATES = 1
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class AdGuardHomeSwitchEntityDescription(SwitchEntityDescription):
|
||||
"""Describes AdGuard Home switch entity."""
|
||||
|
||||
|
@ -56,7 +56,7 @@ from .const import (
|
||||
PARALLEL_UPDATES = 1
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AirlySensorEntityDescription(SensorEntityDescription):
|
||||
"""Class describing Airly sensor entities."""
|
||||
|
||||
|
@ -51,7 +51,7 @@ ATTR_LEVEL = "level"
|
||||
ATTR_STATION = "reporting_station"
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AirNowEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -59,7 +59,7 @@ class AirNowEntityDescriptionMixin:
|
||||
extra_state_attributes_fn: Callable[[Any], dict[str, str]] | None
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AirNowEntityDescription(SensorEntityDescription, AirNowEntityDescriptionMixin):
|
||||
"""Describes Airnow sensor entity."""
|
||||
|
||||
|
@ -37,14 +37,14 @@ from .const import (
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AirQEntityDescriptionMixin:
|
||||
"""Class for keys required by AirQ entity."""
|
||||
|
||||
value: Callable[[dict], float | int | None]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AirQEntityDescription(SensorEntityDescription, AirQEntityDescriptionMixin):
|
||||
"""Describes AirQ sensor entity."""
|
||||
|
||||
|
@ -26,7 +26,7 @@ from . import AirVisualProData, AirVisualProEntity
|
||||
from .const import DOMAIN
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AirVisualProMeasurementKeyMixin:
|
||||
"""Define an entity description mixin to include a measurement key."""
|
||||
|
||||
@ -35,7 +35,7 @@ class AirVisualProMeasurementKeyMixin:
|
||||
]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AirVisualProMeasurementDescription(
|
||||
SensorEntityDescription, AirVisualProMeasurementKeyMixin
|
||||
):
|
||||
|
@ -29,7 +29,7 @@ from .coordinator import AirzoneUpdateCoordinator
|
||||
from .entity import AirzoneEntity, AirzoneSystemEntity, AirzoneZoneEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AirzoneBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||
"""A class that describes airzone binary sensor entities."""
|
||||
|
||||
|
@ -26,7 +26,7 @@ from .coordinator import AirzoneUpdateCoordinator
|
||||
from .entity import AirzoneEntity, AirzoneZoneEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AirzoneSelectDescriptionMixin:
|
||||
"""Define an entity description mixin for select entities."""
|
||||
|
||||
@ -34,7 +34,7 @@ class AirzoneSelectDescriptionMixin:
|
||||
options_dict: dict[str, int]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AirzoneSelectDescription(SelectEntityDescription, AirzoneSelectDescriptionMixin):
|
||||
"""Class to describe an Airzone select entity."""
|
||||
|
||||
|
@ -34,7 +34,7 @@ from .entity import (
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AirzoneBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||
"""A class that describes Airzone Cloud binary sensor entities."""
|
||||
|
||||
|
@ -23,14 +23,14 @@ from .const import DOMAIN
|
||||
from .model import DoorDevice
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AccSensorEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AccSensorEntityDescription(
|
||||
SensorEntityDescription, AccSensorEntityDescriptionMixin
|
||||
):
|
||||
|
@ -63,14 +63,14 @@ TYPE_RELAY8 = "relay8"
|
||||
TYPE_RELAY9 = "relay9"
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AmbientBinarySensorDescriptionMixin:
|
||||
"""Define an entity description mixin for binary sensors."""
|
||||
|
||||
on_state: Literal[0, 1]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AmbientBinarySensorDescription(
|
||||
BinarySensorEntityDescription, AmbientBinarySensorDescriptionMixin
|
||||
):
|
||||
|
@ -35,7 +35,7 @@ if TYPE_CHECKING:
|
||||
from . import AmcrestDevice
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AmcrestSensorEntityDescription(BinarySensorEntityDescription):
|
||||
"""Describe Amcrest sensor entity."""
|
||||
|
||||
|
@ -23,14 +23,14 @@ from .coordinator import AndroidIPCamDataUpdateCoordinator
|
||||
from .entity import AndroidIPCamBaseEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AndroidIPWebcamSensorEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[PyDroidIPCam], StateType]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AndroidIPWebcamSensorEntityDescription(
|
||||
SensorEntityDescription, AndroidIPWebcamSensorEntityDescriptionMixin
|
||||
):
|
||||
|
@ -18,7 +18,7 @@ from .coordinator import AndroidIPCamDataUpdateCoordinator
|
||||
from .entity import AndroidIPCamBaseEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AndroidIPWebcamSwitchEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -26,7 +26,7 @@ class AndroidIPWebcamSwitchEntityDescriptionMixin:
|
||||
off_func: Callable[[PyDroidIPCam], Coroutine[Any, Any, bool]]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AndroidIPWebcamSwitchEntityDescription(
|
||||
SwitchEntityDescription, AndroidIPWebcamSwitchEntityDescriptionMixin
|
||||
):
|
||||
|
@ -23,14 +23,14 @@ from .entity import AnovaDescriptionEntity
|
||||
from .models import AnovaData
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AnovaSensorEntityDescriptionMixin:
|
||||
"""Describes the mixin variables for anova sensors."""
|
||||
|
||||
value_fn: Callable[[APCUpdateSensor], float | int | str]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AnovaSensorEntityDescription(
|
||||
SensorEntityDescription, AnovaSensorEntityDescriptionMixin
|
||||
):
|
||||
|
@ -19,7 +19,7 @@ from .coordinator import AOSmithCoordinator
|
||||
from .entity import AOSmithEntity
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class AOSmithSensorEntityDescription(SensorEntityDescription):
|
||||
"""Define sensor entity description class."""
|
||||
|
||||
|
@ -26,7 +26,7 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
from . import DOMAIN, UPDATE_TOPIC, AquaLogicProcessor
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AquaLogicSensorEntityDescription(SensorEntityDescription):
|
||||
"""Describes AquaLogic sensor entity."""
|
||||
|
||||
|
@ -39,7 +39,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from .const import DOMAIN
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AranetSensorEntityDescription(SensorEntityDescription):
|
||||
"""Class to describe an Aranet sensor entity."""
|
||||
|
||||
|
@ -20,14 +20,14 @@ from .coordinator import AsekoDataUpdateCoordinator
|
||||
from .entity import AsekoEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AsekoBinarySensorDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[Unit], bool]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AsekoBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, AsekoBinarySensorDescriptionMixin
|
||||
):
|
||||
|
@ -38,7 +38,7 @@ from .const import (
|
||||
from .router import AsusWrtRouter
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AsusWrtSensorEntityDescription(SensorEntityDescription):
|
||||
"""A class that describes AsusWrt sensor entities."""
|
||||
|
||||
|
@ -105,12 +105,12 @@ def _native_datetime() -> datetime:
|
||||
return datetime.now()
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AugustBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||
"""Describes August binary_sensor entity."""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AugustDoorbellRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -118,7 +118,7 @@ class AugustDoorbellRequiredKeysMixin:
|
||||
is_time_based: bool
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AugustDoorbellBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, AugustDoorbellRequiredKeysMixin
|
||||
):
|
||||
|
@ -63,14 +63,14 @@ def _retrieve_linked_keypad_battery_state(detail: KeypadDetail) -> int | None:
|
||||
_T = TypeVar("_T", LockDetail, KeypadDetail)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AugustRequiredKeysMixin(Generic[_T]):
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[_T], int | None]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AugustSensorEntityDescription(
|
||||
SensorEntityDescription, AugustRequiredKeysMixin[_T]
|
||||
):
|
||||
|
@ -23,7 +23,7 @@ from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||
from .const import DOMAIN, SERVICE_ID
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class SensorValueEntityDescription(SensorEntityDescription):
|
||||
"""Class describing Aussie Broadband sensor entities."""
|
||||
|
||||
|
@ -50,14 +50,14 @@ from .coordinator import AwairDataUpdateCoordinator, AwairResult
|
||||
DUST_ALIASES = [API_PM25, API_PM10]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AwairRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
unique_id_tag: str
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AwairSensorEntityDescription(SensorEntityDescription, AwairRequiredKeysMixin):
|
||||
"""Describes Awair sensor entity."""
|
||||
|
||||
|
@ -32,7 +32,7 @@ PLATFORMS = [Platform.SENSOR]
|
||||
BUILDS_QUERY: Final = "?queryOrder=queueTimeDescending&maxBuildsPerDefinition=1"
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AzureDevOpsEntityDescription(EntityDescription):
|
||||
"""Class describing Azure DevOps entities."""
|
||||
|
||||
|
@ -17,14 +17,14 @@ from . import AzureDevOpsDeviceEntity, AzureDevOpsEntityDescription
|
||||
from .const import CONF_ORG, DOMAIN
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AzureDevOpsSensorEntityDescriptionMixin:
|
||||
"""Mixin class for required Azure DevOps sensor description keys."""
|
||||
|
||||
build_key: int
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class AzureDevOpsSensorEntityDescription(
|
||||
AzureDevOpsEntityDescription,
|
||||
SensorEntityDescription,
|
||||
|
@ -21,14 +21,14 @@ from .entity import BAFEntity
|
||||
from .models import BAFData
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BAFBinarySensorDescriptionMixin:
|
||||
"""Required values for BAF binary sensors."""
|
||||
|
||||
value_fn: Callable[[Device], bool | None]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BAFBinarySensorDescription(
|
||||
BinarySensorEntityDescription,
|
||||
BAFBinarySensorDescriptionMixin,
|
||||
|
@ -22,14 +22,14 @@ from .entity import BAFEntity
|
||||
from .models import BAFData
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BAFNumberDescriptionMixin:
|
||||
"""Required values for BAF sensors."""
|
||||
|
||||
value_fn: Callable[[Device], int | None]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BAFNumberDescription(NumberEntityDescription, BAFNumberDescriptionMixin):
|
||||
"""Class describing BAF sensor entities."""
|
||||
|
||||
|
@ -28,14 +28,14 @@ from .entity import BAFEntity
|
||||
from .models import BAFData
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BAFSensorDescriptionMixin:
|
||||
"""Required values for BAF sensors."""
|
||||
|
||||
value_fn: Callable[[Device], int | float | str | None]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BAFSensorDescription(
|
||||
SensorEntityDescription,
|
||||
BAFSensorDescriptionMixin,
|
||||
|
@ -18,14 +18,14 @@ from .entity import BAFEntity
|
||||
from .models import BAFData
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BAFSwitchDescriptionMixin:
|
||||
"""Required values for BAF sensors."""
|
||||
|
||||
value_fn: Callable[[Device], bool | None]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BAFSwitchDescription(
|
||||
SwitchEntityDescription,
|
||||
BAFSwitchDescriptionMixin,
|
||||
|
@ -33,7 +33,7 @@ async def async_setup_entry(
|
||||
async_add_entities(entities)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BalboaBinarySensorEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -41,7 +41,7 @@ class BalboaBinarySensorEntityDescriptionMixin:
|
||||
on_off_icons: tuple[str, str]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BalboaBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, BalboaBinarySensorEntityDescriptionMixin
|
||||
):
|
||||
|
@ -109,14 +109,14 @@ def _format_cbs_report(
|
||||
return result
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BMWRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[MyBMWVehicle], bool]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BMWBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, BMWRequiredKeysMixin
|
||||
):
|
||||
|
@ -25,14 +25,14 @@ if TYPE_CHECKING:
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BMWRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
remote_function: Callable[[MyBMWVehicle], Coroutine[Any, Any, RemoteServiceStatus]]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BMWButtonEntityDescription(ButtonEntityDescription, BMWRequiredKeysMixin):
|
||||
"""Class describing BMW button entities."""
|
||||
|
||||
|
@ -26,7 +26,7 @@ from .coordinator import BMWDataUpdateCoordinator
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BMWRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -34,7 +34,7 @@ class BMWRequiredKeysMixin:
|
||||
remote_service: Callable[[MyBMWVehicle, float | int], Coroutine[Any, Any, Any]]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BMWNumberEntityDescription(NumberEntityDescription, BMWRequiredKeysMixin):
|
||||
"""Describes BMW number entity."""
|
||||
|
||||
|
@ -22,7 +22,7 @@ from .coordinator import BMWDataUpdateCoordinator
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BMWRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -30,7 +30,7 @@ class BMWRequiredKeysMixin:
|
||||
remote_service: Callable[[MyBMWVehicle, str], Coroutine[Any, Any, Any]]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BMWSelectEntityDescription(SelectEntityDescription, BMWRequiredKeysMixin):
|
||||
"""Describes BMW sensor entity."""
|
||||
|
||||
|
@ -28,7 +28,7 @@ from .coordinator import BMWDataUpdateCoordinator
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BMWSensorEntityDescription(SensorEntityDescription):
|
||||
"""Describes BMW sensor entity."""
|
||||
|
||||
|
@ -22,7 +22,7 @@ from .coordinator import BMWDataUpdateCoordinator
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BMWRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -31,7 +31,7 @@ class BMWRequiredKeysMixin:
|
||||
remote_service_off: Callable[[MyBMWVehicle], Coroutine[Any, Any, Any]]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BMWSwitchEntityDescription(SwitchEntityDescription, BMWRequiredKeysMixin):
|
||||
"""Describes BMW switch entity."""
|
||||
|
||||
|
@ -21,7 +21,7 @@ from .utils import BondDevice, BondHub
|
||||
STEP_SIZE = 10
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BondButtonEntityDescriptionMixin:
|
||||
"""Mixin to describe a Bond Button entity."""
|
||||
|
||||
@ -29,7 +29,7 @@ class BondButtonEntityDescriptionMixin:
|
||||
argument: int | None
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BondButtonEntityDescription(
|
||||
ButtonEntityDescription, BondButtonEntityDescriptionMixin
|
||||
):
|
||||
|
@ -29,7 +29,7 @@ from .const import DATA_SESSION, DOMAIN
|
||||
from .entity import SHCEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class SHCSwitchRequiredKeysMixin:
|
||||
"""Mixin for SHC switch required keys."""
|
||||
|
||||
@ -38,7 +38,7 @@ class SHCSwitchRequiredKeysMixin:
|
||||
should_poll: bool
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class SHCSwitchEntityDescription(
|
||||
SwitchEntityDescription,
|
||||
SHCSwitchRequiredKeysMixin,
|
||||
|
@ -19,14 +19,14 @@ from .coordinator import BraviaTVCoordinator
|
||||
from .entity import BraviaTVEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BraviaTVButtonDescriptionMixin:
|
||||
"""Mixin to describe a Bravia TV Button entity."""
|
||||
|
||||
press_action: Callable[[BraviaTVCoordinator], Coroutine]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BraviaTVButtonDescription(
|
||||
ButtonEntityDescription, BraviaTVButtonDescriptionMixin
|
||||
):
|
||||
|
@ -35,14 +35,14 @@ UNIT_PAGES = "p"
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BrotherSensorRequiredKeysMixin:
|
||||
"""Class for Brother entity required keys."""
|
||||
|
||||
value: Callable[[BrotherSensors], StateType | datetime]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BrotherSensorEntityDescription(
|
||||
SensorEntityDescription, BrotherSensorRequiredKeysMixin
|
||||
):
|
||||
|
@ -22,7 +22,7 @@ from .const import ATTRIBUTION, DOMAIN
|
||||
from .coordinator import CO2SignalCoordinator
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class CO2SensorEntityDescription(SensorEntityDescription):
|
||||
"""Provide a description of a CO2 sensor."""
|
||||
|
||||
|
@ -79,14 +79,14 @@ ATTR_SUPPLY_TEMPERATURE = "supply_temperature"
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class ComfoconnectRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
sensor_id: int
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class ComfoconnectSensorEntityDescription(
|
||||
SensorEntityDescription, ComfoconnectRequiredKeysMixin
|
||||
):
|
||||
|
@ -39,14 +39,14 @@ from .const import (
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DaikinRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_func: Callable[[Appliance], float | None]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DaikinSensorEntityDescription(SensorEntityDescription, DaikinRequiredKeysMixin):
|
||||
"""Describes Daikin sensor entity."""
|
||||
|
||||
|
@ -65,7 +65,7 @@ T = TypeVar(
|
||||
)
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class DeconzBinarySensorDescription(Generic[T], BinarySensorEntityDescription):
|
||||
"""Class describing deCONZ binary sensor entities."""
|
||||
|
||||
|
@ -23,7 +23,7 @@ from .deconz_device import DeconzDevice, DeconzSceneMixin
|
||||
from .gateway import DeconzGateway, get_gateway_from_config_entry
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class DeconzButtonDescription(ButtonEntityDescription):
|
||||
"""Class describing deCONZ button entities."""
|
||||
|
||||
|
@ -31,7 +31,7 @@ from .util import serial_from_unique_id
|
||||
T = TypeVar("T", Presence, PydeconzSensorBase)
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class DeconzNumberDescription(Generic[T], NumberEntityDescription):
|
||||
"""Class describing deCONZ number entities."""
|
||||
|
||||
|
@ -93,7 +93,7 @@ T = TypeVar(
|
||||
)
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class DeconzSensorDescription(Generic[T], SensorEntityDescription):
|
||||
"""Class describing deCONZ binary sensor entities."""
|
||||
|
||||
|
@ -38,7 +38,7 @@ def get_state(data: dict[str, float], key: str) -> str | float:
|
||||
return round(kb_spd, 2 if kb_spd < 0.1 else 1)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DelugeSensorEntityDescription(SensorEntityDescription):
|
||||
"""Class to describe a Deluge sensor."""
|
||||
|
||||
|
@ -32,14 +32,14 @@ def _is_connected_to_router(entity: DevoloBinarySensorEntity) -> bool:
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DevoloBinarySensorRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_func: Callable[[DevoloBinarySensorEntity], bool]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DevoloBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, DevoloBinarySensorRequiredKeysMixin
|
||||
):
|
||||
|
@ -22,14 +22,14 @@ from .const import DOMAIN, IDENTIFY, PAIRING, RESTART, START_WPS
|
||||
from .entity import DevoloEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DevoloButtonRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
press_func: Callable[[Device], Awaitable[bool]]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DevoloButtonEntityDescription(
|
||||
ButtonEntityDescription, DevoloButtonRequiredKeysMixin
|
||||
):
|
||||
|
@ -21,14 +21,14 @@ from .const import DOMAIN, IMAGE_GUEST_WIFI, SWITCH_GUEST_WIFI
|
||||
from .entity import DevoloCoordinatorEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DevoloImageRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
image_func: Callable[[WifiGuestAccessGet], bytes]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DevoloImageEntityDescription(
|
||||
ImageEntityDescription, DevoloImageRequiredKeysMixin
|
||||
):
|
||||
|
@ -49,14 +49,14 @@ class DataRateDirection(StrEnum):
|
||||
TX = "tx_rate"
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DevoloSensorRequiredKeysMixin(Generic[_CoordinatorDataT]):
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_func: Callable[[_CoordinatorDataT], float]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DevoloSensorEntityDescription(
|
||||
SensorEntityDescription, DevoloSensorRequiredKeysMixin[_CoordinatorDataT]
|
||||
):
|
||||
|
@ -23,7 +23,7 @@ from .entity import DevoloCoordinatorEntity
|
||||
_DataT = TypeVar("_DataT", bound=WifiGuestAccessGet | bool)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DevoloSwitchRequiredKeysMixin(Generic[_DataT]):
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -32,7 +32,7 @@ class DevoloSwitchRequiredKeysMixin(Generic[_DataT]):
|
||||
turn_off_func: Callable[[Device], Awaitable[bool]]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DevoloSwitchEntityDescription(
|
||||
SwitchEntityDescription, DevoloSwitchRequiredKeysMixin[_DataT]
|
||||
):
|
||||
|
@ -26,7 +26,7 @@ from .const import DOMAIN, REGULAR_FIRMWARE
|
||||
from .entity import DevoloCoordinatorEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DevoloUpdateRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -34,7 +34,7 @@ class DevoloUpdateRequiredKeysMixin:
|
||||
update_func: Callable[[Device], Awaitable[bool]]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DevoloUpdateEntityDescription(
|
||||
UpdateEntityDescription, DevoloUpdateRequiredKeysMixin
|
||||
):
|
||||
|
@ -35,7 +35,7 @@ def _get_and_scale(reading: Reading, key: str, scale: int) -> datetime | float |
|
||||
return None
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class DiscovergySensorEntityDescription(SensorEntityDescription):
|
||||
"""Class to describe a Discovergy sensor entity."""
|
||||
|
||||
|
@ -17,14 +17,14 @@ from .models import DoorBirdData
|
||||
IR_RELAY = "__ir_light__"
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DoorbirdButtonEntityDescriptionMixin:
|
||||
"""Mixin to describe a Doorbird Button entity."""
|
||||
|
||||
press_action: Callable[[DoorBird, str], None]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DoorbirdButtonEntityDescription(
|
||||
ButtonEntityDescription, DoorbirdButtonEntityDescriptionMixin
|
||||
):
|
||||
|
@ -22,14 +22,14 @@ from .entity import DormakabaDkeyEntity
|
||||
from .models import DormakabaDkeyData
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DormakabaDkeyBinarySensorDescriptionMixin:
|
||||
"""Class for keys required by Dormakaba dKey binary sensor entity."""
|
||||
|
||||
is_on: Callable[[Notifications], bool]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DormakabaDkeyBinarySensorDescription(
|
||||
BinarySensorEntityDescription, DormakabaDkeyBinarySensorDescriptionMixin
|
||||
):
|
||||
|
@ -30,14 +30,14 @@ SENSOR_NETWORK = "network"
|
||||
SENSOR_SMS_UNREAD = "sms"
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DovadoRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
identifier: str
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DovadoSensorEntityDescription(SensorEntityDescription, DovadoRequiredKeysMixin):
|
||||
"""Describes Dovado sensor entity."""
|
||||
|
||||
|
@ -19,14 +19,14 @@ from .const import DOMAIN
|
||||
from .entity import Dremel3DPrinterEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class Dremel3DPrinterBinarySensorEntityMixin:
|
||||
"""Mixin for Dremel 3D Printer binary sensor."""
|
||||
|
||||
value_fn: Callable[[Dremel3DPrinter], bool]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class Dremel3DPrinterBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, Dremel3DPrinterBinarySensorEntityMixin
|
||||
):
|
||||
|
@ -16,14 +16,14 @@ from .const import DOMAIN
|
||||
from .entity import Dremel3DPrinterEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class Dremel3DPrinterButtonEntityMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
press_fn: Callable[[Dremel3DPrinter], None]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class Dremel3DPrinterButtonEntityDescription(
|
||||
ButtonEntityDescription, Dremel3DPrinterButtonEntityMixin
|
||||
):
|
||||
|
@ -31,14 +31,14 @@ from .const import ATTR_EXTRUDER, ATTR_PLATFORM, DOMAIN
|
||||
from .entity import Dremel3DPrinterEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class Dremel3DPrinterSensorEntityMixin:
|
||||
"""Mixin for Dremel 3D Printer sensor."""
|
||||
|
||||
value_fn: Callable[[Dremel3DPrinter, str], StateType | datetime]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class Dremel3DPrinterSensorEntityDescription(
|
||||
SensorEntityDescription, Dremel3DPrinterSensorEntityMixin
|
||||
):
|
||||
|
@ -67,7 +67,7 @@ EVENT_FIRST_TELEGRAM = "dsmr_first_telegram_{}"
|
||||
UNIT_CONVERSION = {"m3": UnitOfVolume.CUBIC_METERS}
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class DSMRSensorEntityDescription(SensorEntityDescription):
|
||||
"""Represents an DSMR Sensor."""
|
||||
|
||||
|
@ -38,7 +38,7 @@ def tariff_transform(value):
|
||||
return "high"
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class DSMRReaderSensorEntityDescription(SensorEntityDescription):
|
||||
"""Sensor entity description for DSMR Reader."""
|
||||
|
||||
|
@ -29,7 +29,7 @@ from .const import DOMAIN, SERVICE_TYPE_DEVICE_NAMES
|
||||
from .coordinator import EasyEnergyData, EasyEnergyDataUpdateCoordinator
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EasyEnergySensorEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -37,7 +37,7 @@ class EasyEnergySensorEntityDescriptionMixin:
|
||||
service_type: str
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EasyEnergySensorEntityDescription(
|
||||
SensorEntityDescription, EasyEnergySensorEntityDescriptionMixin
|
||||
):
|
||||
|
@ -18,7 +18,7 @@ from .entity import EcobeeBaseEntity
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EcobeeNumberEntityDescriptionBase:
|
||||
"""Required values when describing Ecobee number entities."""
|
||||
|
||||
@ -26,7 +26,7 @@ class EcobeeNumberEntityDescriptionBase:
|
||||
set_fn: Callable[[EcobeeData, int, int], Awaitable]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EcobeeNumberEntityDescription(
|
||||
NumberEntityDescription, EcobeeNumberEntityDescriptionBase
|
||||
):
|
||||
|
@ -25,14 +25,14 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from .const import DOMAIN, ECOBEE_MODEL_TO_NAME, MANUFACTURER
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EcobeeSensorEntityDescriptionMixin:
|
||||
"""Represent the required ecobee entity description attributes."""
|
||||
|
||||
runtime_key: str | None
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EcobeeSensorEntityDescription(
|
||||
SensorEntityDescription, EcobeeSensorEntityDescriptionMixin
|
||||
):
|
||||
|
@ -16,14 +16,14 @@ from .coordinator import EcoforestCoordinator
|
||||
from .entity import EcoforestEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EcoforestRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[Device], float | None]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EcoforestNumberEntityDescription(
|
||||
NumberEntityDescription, EcoforestRequiredKeysMixin
|
||||
):
|
||||
|
@ -33,14 +33,14 @@ STATUS_TYPE = [s.value for s in State]
|
||||
ALARM_TYPE = [a.value for a in Alarm] + ["none"]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EcoforestRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[Device], StateType]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EcoforestSensorEntityDescription(
|
||||
SensorEntityDescription, EcoforestRequiredKeysMixin
|
||||
):
|
||||
|
@ -17,7 +17,7 @@ from .coordinator import EcoforestCoordinator
|
||||
from .entity import EcoforestEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EcoforestSwitchRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -25,7 +25,7 @@ class EcoforestSwitchRequiredKeysMixin:
|
||||
switch_fn: Callable[[EcoforestApi, bool], Awaitable[Device]]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EcoforestSwitchEntityDescription(
|
||||
SwitchEntityDescription, EcoforestSwitchRequiredKeysMixin
|
||||
):
|
||||
|
@ -28,14 +28,14 @@ ATTR_EK_HOP_START = "hop_sensor_start"
|
||||
ATTR_EK_HOP_END = "hop_sensor_end"
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class ElectricKiwiHOPRequiredKeysMixin:
|
||||
"""Mixin for required HOP keys."""
|
||||
|
||||
value_func: Callable[[Hop], datetime]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class ElectricKiwiHOPSensorEntityDescription(
|
||||
SensorEntityDescription,
|
||||
ElectricKiwiHOPRequiredKeysMixin,
|
||||
|
@ -23,7 +23,7 @@ from .coordinator import ElgatoDataUpdateCoordinator
|
||||
from .entity import ElgatoEntity
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class ElgatoButtonEntityDescription(ButtonEntityDescription):
|
||||
"""Class describing Elgato button entities."""
|
||||
|
||||
|
@ -26,7 +26,7 @@ from .coordinator import ElgatoData, ElgatoDataUpdateCoordinator
|
||||
from .entity import ElgatoEntity
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class ElgatoSensorEntityDescription(SensorEntityDescription):
|
||||
"""Class describing Elgato sensor entities."""
|
||||
|
||||
|
@ -19,7 +19,7 @@ from .coordinator import ElgatoData, ElgatoDataUpdateCoordinator
|
||||
from .entity import ElgatoEntity
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class ElgatoSwitchEntityDescription(SwitchEntityDescription):
|
||||
"""Class describing Elgato switch entities."""
|
||||
|
||||
|
@ -29,7 +29,7 @@ from .const import DOMAIN, SERVICE_TYPE_DEVICE_NAMES
|
||||
from .coordinator import EnergyZeroData, EnergyZeroDataUpdateCoordinator
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnergyZeroSensorEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -37,7 +37,7 @@ class EnergyZeroSensorEntityDescriptionMixin:
|
||||
service_type: str
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnergyZeroSensorEntityDescription(
|
||||
SensorEntityDescription, EnergyZeroSensorEntityDescriptionMixin
|
||||
):
|
||||
|
@ -44,14 +44,14 @@ SENSOR_TYPE_TEMPERATURE = "temperature"
|
||||
SENSOR_TYPE_WINDOWHANDLE = "windowhandle"
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnOceanSensorEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
unique_id: Callable[[list[int]], str | None]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnOceanSensorEntityDescription(
|
||||
SensorEntityDescription, EnOceanSensorEntityDescriptionMixin
|
||||
):
|
||||
|
@ -22,14 +22,14 @@ from .coordinator import EnphaseUpdateCoordinator
|
||||
from .entity import EnvoyBaseEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyEnchargeRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[EnvoyEncharge], bool]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyEnchargeBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, EnvoyEnchargeRequiredKeysMixin
|
||||
):
|
||||
@ -53,14 +53,14 @@ ENCHARGE_SENSORS = (
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyEnpowerRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[EnvoyEnpower], bool]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyEnpowerBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, EnvoyEnpowerRequiredKeysMixin
|
||||
):
|
||||
|
@ -25,21 +25,21 @@ from .coordinator import EnphaseUpdateCoordinator
|
||||
from .entity import EnvoyBaseEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyRelayRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[EnvoyDryContactSettings], float]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyRelayNumberEntityDescription(
|
||||
NumberEntityDescription, EnvoyRelayRequiredKeysMixin
|
||||
):
|
||||
"""Describes an Envoy Dry Contact Relay number entity."""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyStorageSettingsRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -47,7 +47,7 @@ class EnvoyStorageSettingsRequiredKeysMixin:
|
||||
update_fn: Callable[[Envoy, float], Awaitable[dict[str, Any]]]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyStorageSettingsNumberEntityDescription(
|
||||
NumberEntityDescription, EnvoyStorageSettingsRequiredKeysMixin
|
||||
):
|
||||
|
@ -21,7 +21,7 @@ from .coordinator import EnphaseUpdateCoordinator
|
||||
from .entity import EnvoyBaseEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyRelayRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -31,14 +31,14 @@ class EnvoyRelayRequiredKeysMixin:
|
||||
]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyRelaySelectEntityDescription(
|
||||
SelectEntityDescription, EnvoyRelayRequiredKeysMixin
|
||||
):
|
||||
"""Describes an Envoy Dry Contact Relay select entity."""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyStorageSettingsRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -46,7 +46,7 @@ class EnvoyStorageSettingsRequiredKeysMixin:
|
||||
update_fn: Callable[[Envoy, str], Awaitable[dict[str, Any]]]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyStorageSettingsSelectEntityDescription(
|
||||
SelectEntityDescription, EnvoyStorageSettingsRequiredKeysMixin
|
||||
):
|
||||
|
@ -47,14 +47,14 @@ INVERTERS_KEY = "inverters"
|
||||
LAST_REPORTED_KEY = "last_reported"
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyInverterRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[EnvoyInverter], datetime.datetime | float]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyInverterSensorEntityDescription(
|
||||
SensorEntityDescription, EnvoyInverterRequiredKeysMixin
|
||||
):
|
||||
@ -80,14 +80,14 @@ INVERTER_SENSORS = (
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyProductionRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[EnvoySystemProduction], int]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyProductionSensorEntityDescription(
|
||||
SensorEntityDescription, EnvoyProductionRequiredKeysMixin
|
||||
):
|
||||
@ -137,14 +137,14 @@ PRODUCTION_SENSORS = (
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyConsumptionRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[EnvoySystemConsumption], int]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyConsumptionSensorEntityDescription(
|
||||
SensorEntityDescription, EnvoyConsumptionRequiredKeysMixin
|
||||
):
|
||||
@ -194,28 +194,28 @@ CONSUMPTION_SENSORS = (
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyEnchargeRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[EnvoyEncharge], datetime.datetime | int | float]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyEnchargeSensorEntityDescription(
|
||||
SensorEntityDescription, EnvoyEnchargeRequiredKeysMixin
|
||||
):
|
||||
"""Describes an Envoy Encharge sensor entity."""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyEnchargePowerRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[EnvoyEnchargePower], int | float]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyEnchargePowerSensorEntityDescription(
|
||||
SensorEntityDescription, EnvoyEnchargePowerRequiredKeysMixin
|
||||
):
|
||||
@ -259,14 +259,14 @@ ENCHARGE_POWER_SENSORS = (
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyEnpowerRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[EnvoyEnpower], datetime.datetime | int | float]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyEnpowerSensorEntityDescription(
|
||||
SensorEntityDescription, EnvoyEnpowerRequiredKeysMixin
|
||||
):
|
||||
@ -289,14 +289,14 @@ ENPOWER_SENSORS = (
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyEnchargeAggregateRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[EnvoyEnchargeAggregate], int]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyEnchargeAggregateSensorEntityDescription(
|
||||
SensorEntityDescription, EnvoyEnchargeAggregateRequiredKeysMixin
|
||||
):
|
||||
|
@ -24,7 +24,7 @@ from .entity import EnvoyBaseEntity
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyEnpowerRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -33,14 +33,14 @@ class EnvoyEnpowerRequiredKeysMixin:
|
||||
turn_off_fn: Callable[[Envoy], Coroutine[Any, Any, dict[str, Any]]]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyEnpowerSwitchEntityDescription(
|
||||
SwitchEntityDescription, EnvoyEnpowerRequiredKeysMixin
|
||||
):
|
||||
"""Describes an Envoy Enpower switch entity."""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyDryContactRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -49,14 +49,14 @@ class EnvoyDryContactRequiredKeysMixin:
|
||||
turn_off_fn: Callable[[Envoy, str], Coroutine[Any, Any, dict[str, Any]]]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyDryContactSwitchEntityDescription(
|
||||
SwitchEntityDescription, EnvoyDryContactRequiredKeysMixin
|
||||
):
|
||||
"""Describes an Envoy Enpower dry contact switch entity."""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyStorageSettingsRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
@ -65,7 +65,7 @@ class EnvoyStorageSettingsRequiredKeysMixin:
|
||||
turn_off_fn: Callable[[Envoy], Awaitable[dict[str, Any]]]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EnvoyStorageSettingsSwitchEntityDescription(
|
||||
SwitchEntityDescription, EnvoyStorageSettingsRequiredKeysMixin
|
||||
):
|
||||
|
@ -33,14 +33,14 @@ from .const import ATTR_STATION, DOMAIN
|
||||
ATTR_TIME = "alert time"
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class ECSensorEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[Any], Any]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class ECSensorEntityDescription(
|
||||
SensorEntityDescription, ECSensorEntityDescriptionMixin
|
||||
):
|
||||
|
@ -33,14 +33,14 @@ SCAN_INTERVAL = timedelta(seconds=60)
|
||||
PARALLEL_UPDATES = 0
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EzvizAlarmControlPanelEntityDescriptionMixin:
|
||||
"""Mixin values for EZVIZ Alarm control panel entities."""
|
||||
|
||||
ezviz_alarm_states: list
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EzvizAlarmControlPanelEntityDescription(
|
||||
AlarmControlPanelEntityDescription, EzvizAlarmControlPanelEntityDescriptionMixin
|
||||
):
|
||||
|
@ -22,7 +22,7 @@ from .entity import EzvizEntity
|
||||
PARALLEL_UPDATES = 1
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EzvizButtonEntityDescriptionMixin:
|
||||
"""Mixin values for EZVIZ button entities."""
|
||||
|
||||
@ -30,7 +30,7 @@ class EzvizButtonEntityDescriptionMixin:
|
||||
supported_ext: str
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EzvizButtonEntityDescription(
|
||||
ButtonEntityDescription, EzvizButtonEntityDescriptionMixin
|
||||
):
|
||||
|
@ -30,7 +30,7 @@ PARALLEL_UPDATES = 0
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EzvizNumberEntityDescriptionMixin:
|
||||
"""Mixin values for EZVIZ Number entities."""
|
||||
|
||||
@ -38,7 +38,7 @@ class EzvizNumberEntityDescriptionMixin:
|
||||
supported_ext_value: list
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EzvizNumberEntityDescription(
|
||||
NumberEntityDescription, EzvizNumberEntityDescriptionMixin
|
||||
):
|
||||
|
@ -20,14 +20,14 @@ from .entity import EzvizEntity
|
||||
PARALLEL_UPDATES = 1
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EzvizSelectEntityDescriptionMixin:
|
||||
"""Mixin values for EZVIZ Select entities."""
|
||||
|
||||
supported_switch: int
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EzvizSelectEntityDescription(
|
||||
SelectEntityDescription, EzvizSelectEntityDescriptionMixin
|
||||
):
|
||||
|
@ -22,14 +22,14 @@ from .coordinator import EzvizDataUpdateCoordinator
|
||||
from .entity import EzvizEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EzvizSwitchEntityDescriptionMixin:
|
||||
"""Mixin values for EZVIZ Switch entities."""
|
||||
|
||||
supported_ext: str | None
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EzvizSwitchEntityDescription(
|
||||
SwitchEntityDescription, EzvizSwitchEntityDescriptionMixin
|
||||
):
|
||||
|
@ -21,7 +21,7 @@ from . import FAADataUpdateCoordinator
|
||||
from .const import DOMAIN
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class FaaDelaysBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||
"""Mixin for required keys."""
|
||||
|
||||
|
@ -146,7 +146,7 @@ def _int_value_or_none(field: str) -> Callable[[dict[str, Any]], int | None]:
|
||||
return convert
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class FitbitSensorEntityDescription(SensorEntityDescription):
|
||||
"""Describes Fitbit sensor entity."""
|
||||
|
||||
|
@ -14,7 +14,7 @@ from .const import DOMAIN, NAME_STATUS
|
||||
from .entity import FiveMEntity, FiveMEntityDescription
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class FiveMBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, FiveMEntityDescription
|
||||
):
|
||||
|
@ -16,7 +16,7 @@ from .coordinator import FiveMDataUpdateCoordinator
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class FiveMEntityDescription(EntityDescription):
|
||||
"""Describes FiveM entity."""
|
||||
|
||||
|
@ -24,7 +24,7 @@ from .const import (
|
||||
from .entity import FiveMEntity, FiveMEntityDescription
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class FiveMSensorEntityDescription(SensorEntityDescription, FiveMEntityDescription):
|
||||
"""Describes FiveM sensor entity."""
|
||||
|
||||
|
@ -22,7 +22,7 @@ from . import async_setup_entry_platform
|
||||
from .coordinator import FjaraskupanCoordinator
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class EntityDescription(BinarySensorEntityDescription):
|
||||
"""Entity description."""
|
||||
|
||||
|
@ -39,14 +39,14 @@ BINARY_SENSOR_DESCRIPTION_CONNECTED = BinarySensorEntityDescription(
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class FlumeBinarySensorRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
event_rule: str
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class FlumeBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, FlumeBinarySensorRequiredKeysMixin
|
||||
):
|
||||
|
@ -27,7 +27,7 @@ from .const import DOMAIN
|
||||
from .coordinator import ForecastSolarDataUpdateCoordinator
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class ForecastSolarSensorEntityDescription(SensorEntityDescription):
|
||||
"""Describes a Forecast.Solar Sensor."""
|
||||
|
||||
|
@ -18,14 +18,14 @@ from .const import DOMAIN
|
||||
from .router import FreeboxRouter
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class FreeboxButtonRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
async_press: Callable[[FreeboxRouter], Awaitable]
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class FreeboxButtonEntityDescription(
|
||||
ButtonEntityDescription, FreeboxButtonRequiredKeysMixin
|
||||
):
|
||||
|
@ -26,7 +26,7 @@ from .const import DOMAIN
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class FritzBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, FritzEntityDescription
|
||||
):
|
||||
|
@ -23,14 +23,14 @@ from .const import DOMAIN
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class FritzButtonDescriptionMixin:
|
||||
"""Mixin to describe a Button entity."""
|
||||
|
||||
press_action: Callable
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(frozen=True)
|
||||
class FritzButtonDescription(ButtonEntityDescription, FritzButtonDescriptionMixin):
|
||||
"""Class to describe a Button entity."""
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user