Clean dead code from matter (#90369)
This commit is contained in:
parent
f84651b14e
commit
18933df95c
1 changed files with 2 additions and 15 deletions
|
@ -2,8 +2,8 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from dataclasses import asdict, dataclass
|
from dataclasses import dataclass
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import Any
|
||||||
|
|
||||||
from chip.clusters import Objects as clusters
|
from chip.clusters import Objects as clusters
|
||||||
from chip.clusters.Objects import ClusterAttributeDescriptor
|
from chip.clusters.Objects import ClusterAttributeDescriptor
|
||||||
|
@ -13,19 +13,6 @@ from matter_server.client.models.node import MatterEndpoint
|
||||||
from homeassistant.const import Platform
|
from homeassistant.const import Platform
|
||||||
from homeassistant.helpers.entity import EntityDescription
|
from homeassistant.helpers.entity import EntityDescription
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from _typeshed import DataclassInstance
|
|
||||||
|
|
||||||
|
|
||||||
class DataclassMustHaveAtLeastOne:
|
|
||||||
"""A dataclass that must have at least one input parameter that is not None."""
|
|
||||||
|
|
||||||
def __post_init__(self: DataclassInstance) -> None:
|
|
||||||
"""Post dataclass initialization."""
|
|
||||||
if all(val is None for val in asdict(self).values()):
|
|
||||||
raise ValueError("At least one input parameter must not be None")
|
|
||||||
|
|
||||||
|
|
||||||
SensorValueTypes = type[
|
SensorValueTypes = type[
|
||||||
clusters.uint | int | clusters.Nullable | clusters.float32 | float
|
clusters.uint | int | clusters.Nullable | clusters.float32 | float
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Reference in a new issue