1
mirror of https://github.com/home-assistant/core synced 2024-07-15 09:42:11 +02:00

Remove gree switch entity description required fields mixin (#105849)

This commit is contained in:
Jan-Philipp Benecke 2023-12-19 10:35:19 +01:00 committed by GitHub
parent ed9e738985
commit 40f30675dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,19 +21,14 @@ from .const import COORDINATORS, DISPATCH_DEVICE_DISCOVERED, DOMAIN
from .entity import GreeEntity
@dataclass(frozen=True)
class GreeRequiredKeysMixin:
"""Mixin for required keys."""
@dataclass(kw_only=True, frozen=True)
class GreeSwitchEntityDescription(SwitchEntityDescription):
"""Describes a Gree switch entity."""
get_value_fn: Callable[[Device], bool]
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:
"""Typed helper to set device light property."""
device.light = value