mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Remove gree switch entity description required fields mixin (#105849)
This commit is contained in:
parent
ed9e738985
commit
40f30675dd
@ -21,19 +21,14 @@ from .const import COORDINATORS, DISPATCH_DEVICE_DISCOVERED, DOMAIN
|
|||||||
from .entity import GreeEntity
|
from .entity import GreeEntity
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(kw_only=True, frozen=True)
|
||||||
class GreeRequiredKeysMixin:
|
class GreeSwitchEntityDescription(SwitchEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Describes a Gree switch entity."""
|
||||||
|
|
||||||
get_value_fn: Callable[[Device], bool]
|
get_value_fn: Callable[[Device], bool]
|
||||||
set_value_fn: Callable[[Device, bool], None]
|
set_value_fn: Callable[[Device, bool], None]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class GreeSwitchEntityDescription(SwitchEntityDescription, GreeRequiredKeysMixin):
|
|
||||||
"""Describes Gree switch entity."""
|
|
||||||
|
|
||||||
|
|
||||||
def _set_light(device: Device, value: bool) -> None:
|
def _set_light(device: Device, value: bool) -> None:
|
||||||
"""Typed helper to set device light property."""
|
"""Typed helper to set device light property."""
|
||||||
device.light = value
|
device.light = value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user