Add entity translations to Wiz (#96826)

This commit is contained in:
Joost Lekkerkerker 2023-07-22 16:28:48 +02:00 committed by GitHub
parent 47426e50d3
commit 11fd43b1fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 6 deletions

View file

@ -49,11 +49,11 @@ async def _async_set_ratio(device: wizlight, ratio: int) -> None:
NUMBERS: tuple[WizNumberEntityDescription, ...] = (
WizNumberEntityDescription(
key="effect_speed",
translation_key="effect_speed",
native_min_value=10,
native_max_value=200,
native_step=1,
icon="mdi:speedometer",
name="Effect speed",
value_fn=lambda device: cast(int | None, device.state.get_speed()),
set_value_fn=_async_set_speed,
required_feature="effect",
@ -61,11 +61,11 @@ NUMBERS: tuple[WizNumberEntityDescription, ...] = (
),
WizNumberEntityDescription(
key="dual_head_ratio",
translation_key="dual_head_ratio",
native_min_value=0,
native_max_value=100,
native_step=1,
icon="mdi:floor-lamp-dual",
name="Dual head ratio",
value_fn=lambda device: cast(int | None, device.state.get_ratio()),
set_value_fn=_async_set_ratio,
required_feature="dual_head",