mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix modification of mutable global in xiaomi_miio number (#73579)
This commit is contained in:
parent
e2327622c3
commit
3e1a4d86a3
@ -1,6 +1,7 @@
|
|||||||
"""Motor speed support for Xiaomi Mi Air Humidifier."""
|
"""Motor speed support for Xiaomi Mi Air Humidifier."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import dataclasses
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
from homeassistant.components.number import NumberEntity, NumberEntityDescription
|
from homeassistant.components.number import NumberEntity, NumberEntityDescription
|
||||||
@ -273,9 +274,12 @@ async def async_setup_entry(
|
|||||||
description.key == ATTR_OSCILLATION_ANGLE
|
description.key == ATTR_OSCILLATION_ANGLE
|
||||||
and model in OSCILLATION_ANGLE_VALUES
|
and model in OSCILLATION_ANGLE_VALUES
|
||||||
):
|
):
|
||||||
description.max_value = OSCILLATION_ANGLE_VALUES[model].max_value
|
description = dataclasses.replace(
|
||||||
description.min_value = OSCILLATION_ANGLE_VALUES[model].min_value
|
description,
|
||||||
description.step = OSCILLATION_ANGLE_VALUES[model].step
|
native_max_value=OSCILLATION_ANGLE_VALUES[model].max_value,
|
||||||
|
native_min_value=OSCILLATION_ANGLE_VALUES[model].min_value,
|
||||||
|
native_step=OSCILLATION_ANGLE_VALUES[model].step,
|
||||||
|
)
|
||||||
|
|
||||||
entities.append(
|
entities.append(
|
||||||
XiaomiNumberEntity(
|
XiaomiNumberEntity(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user