Remove Wiz entity descriptions required fields mixins (#104005)

pull/92906/head^2
Franck Nijhof 2023-11-24 11:26:21 +01:00 committed by GitHub
parent 6f54aaf564
commit 560ac3d087
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 13 deletions

View File

@ -22,21 +22,14 @@ from .entity import WizEntity
from .models import WizData
@dataclass
class WizNumberEntityDescriptionMixin:
"""Mixin to describe a WiZ number entity."""
value_fn: Callable[[wizlight], int | None]
set_value_fn: Callable[[wizlight, int], Coroutine[None, None, None]]
required_feature: str
@dataclass
class WizNumberEntityDescription(
NumberEntityDescription, WizNumberEntityDescriptionMixin
):
@dataclass(kw_only=True)
class WizNumberEntityDescription(NumberEntityDescription):
"""Class to describe a WiZ number entity."""
required_feature: str
set_value_fn: Callable[[wizlight, int], Coroutine[None, None, None]]
value_fn: Callable[[wizlight], int | None]
async def _async_set_speed(device: wizlight, speed: int) -> None:
await device.set_speed(speed)